...
Wiki Markup |
---|
The TR 24731-1 {{tmpnam_s()}} function generates a string that is a valid filename and that is not the same as the name of an existing file \[[ISO/IEC TR 24731-1-2007|AA. C References#SO/IEC TR 24731-1-2007]\]. It is almost identical to the {{tmpnam{}}} function above except with an added {{maxsize}} argument for the supplied buffer. |
...
After a program obtains a file name using the
tmpnam_s
function and before the
program creates a file with that name, the possibility exists that someone else may create
a file with that same name. To avoid this race condition, thetmpfile_s
function
should be used instead oftmpnam_s
when possible. One situation that requires the use
of thetmpnam_s
function is when the program needs to create a temporary directory
rather than a temporary file.
...