Files should be created with appropriate access permissions. Creating a file with insufficient file access permissions may allow unintended access to program-critical those files. File Although access permissions are heavily dependent on the underlying operating system. However, many file creation functions provide a way to influence mechanisms to set (or at least influence) access permissions. Setting When these functions are used to create files appropriate access permissions on newly created files prevents should be specified to prevent unintended access to those files.
...
The fopen()
function does not provide a mechanism allow the programmer to explicitly specify file access permissions. In the example below, if the call to fopen()
creates a new file, the access permissions for that file will be implementation defined.
...