Is using fchmod(int fildes, mode_t mode) a better idea than using chmod(const char * path, mode_t mode)?
Is using fchmod(int fildes, mode_t mode) a better idea than using chmod(const char *
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s pretty much identical.
chmodwill take ever so slightly little longer as it has to convert the path to an inode or filenode, whereasfchmodhas the inode/filenode already looked up.Of course, there are fewer error conditions which could occur with
fchmodsince the file is already known to exist, have permission for open, etc.