Constructs the name for a temporary file.
#include <stdio.h> char *tempnam (const char *directory, const char *prefix);
If the directory argument is null or points to a string that is not a pathname for an appropriate directory, the pathname defined as P_tmpdir in the <stdio.h> header file is used.
You can bypass the selection of a pathname by providing the TMPDIR environment variable in the user environment. The value of the TMPDIR variable is a pathname for the desired temporary file directory.
Use the prefix argument to specify a prefix of up to 5 characters for the temporary filename.
See also free in this section.
x | A pointer to the generated pathname, suitable for use in a subsequent call to the free function. |
NULL | An error occurred; errno is set to indicate the error. |