> Sure, I don't see why not. I recommend you do some debugging to see > what's going wrong when -1 is returned, e.g., what is the value of > errno? Sorry ,it returns 1 not -1. How can i get the value of errno? Thanks.