Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The fopen_s() function defined in ISO/IEC TR 24731-2006 provides some control over file access permissions. Specifically, the report states: "If the file is being created, and the first character of the mode string is not 'u', to the extent that the underlying system supports it, the file shall have a file permission that prevents other users on the system from accessing the file."

Code Block
...
FILEFile * fptrfptr;
errno_t res = fopen_s(&fptr,file_name, "w");
if (res !fptr= 0) {
  /* Handle Error */
}
...

...