...
The open()
function, as defined in in the Standard for Information Technology—Portable Operating System Interface (POSIX®), Base Specifications, Issue 7 [IEEE Std 1003.1:2013], is available on many platforms and provides finer control than fopen()
. In particular, open()
accepts the O_CREAT
and O_EXCL
flags. When used together, these flags instruct the open()
function to fail if the file specified by file_name
already exists.
...