...
Wiki Markup |
---|
The {{fopen_s()}} function defined in ISO/IEC TR 24731-1 \[[ISO/IEC TR 24731-1-2007|AA. C References#ISO/IEC TR 24731-1-2007]\] can be used to create a file with restricedrestricted permissions. Specifically, ISO/IEC TR 24731-1 states: |
...
Access permissions for the newly created file should be specified in the third parameter to open()
. Again, the permissions may will be influenced modified by the value of umask()
.
Code Block | ||
---|---|---|
| ||
/* ... */ int fd = open(file_name, O_CREAT | O_WRONLY, file_access_permissions); if (fd == -1){ /* Handle Error */ } /* ... */ |
...