Is using fchmod(int fildes, mode_t mode)
a better idea than using chmod(const char * path, mode_t mode)?
It's pretty much identical. chmod
will take ever so slightly little longer as it has to convert the path to an inode or filenode, whereas fchmod
has the inode/filenode already looked up.
Of course, there are fewer error conditions which could occur with fchmod
since the file is already known to exist, have permission for open, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With