File permissions and umask()
Access permissions can be specified during creation of files.
The above code creates a file with default permission : execute permissions for writer (permissions could very well depend on the system).
Unix, as we know, allows three kinds of file access mainly : own
|S_IRUSR||Read permission, owner|
|S_IWUSR||Write permission, owner|
|S_IXUSR||Execute permission, owner|
|S_IRGRP||Read permission, group|
|S_IWGRP||Write permission, group|
|S_IXGRP||Execute permission, group|
|S_IROTH||Read permission, others|
|S_IWOTH||Write permission, others|
|S_IXOTH||Execute permission, others|
View original post 7 more words