Table of Contents
The
function takes the given file name template and overwrites a portion of
it to create a file name. This file name is unique and suitable for use
by the application. The template may be any file name with some number of
appended to it, for example The trailing are replaced with the current
process number and/or a unique letter combination. The number of unique
file names can return depends on the number of provided; six will result
in testing roughly 26 ** 6 combinations. The function makes the same
replacement to the template and creates the template file, mode 0600, returning
a file descriptor opened for reading and writing. This avoids the race between
testing for a file’s existence and opening it for use.
The
function returns a pointer to the template on success and on failure. The
function returns -1 if no suitable file could be created. If either call
fails an error code is placed in the global variable
The and functions
may set to one of the following values: The pathname portion of the
template is not an existing directory. The and functions may also set
to any value specified by the function. The function may also set to
any value specified by the function.
A function appeared
in
Table of Contents