- Mkstemp
In
computing ,mkstemp
is anUNIX function for creating atemporary file , acomputer file which ceases to exist when the program, which opened the file, closes it or terminates. [http://www.opengroup.org/onlinepubs/009695399/functions/mkstemp.html mkstemp] byOpenGroup ]Usage
Inclusion
; C; C++
Declaration
int mkstemp(char* template);
Requirements
* The parameter
template
must be a modifiable, null-terminated character array.
* The contents oftemplate
must be in the format of a valid file path, with six trailing 'X's.
* The parametertemplate
must not have been used in a previous invocation ofmkstemp
.emantics
* The trailing 'X's in
template
are overwritten to generate an unique file name for the resulting temporary file.
* The function reports a validfile descriptor to atemporary file on success; on failure, it reports-1
.Error conditions
It is unspecified if
mkstemp
setserrno , and what values oferrno are set, in the event of failure.References
ee also
*
tmpfile
*tmpfile_s
*mktemp
*mkstemps
*tmpname
*tmpnam
Wikimedia Foundation. 2010.