mktemp(3C) mktemp(3C)
NAME
mktemp - make a unique filename
SYNOPSIS
#include <stdlib.h>
char *mktemp(char *template);
DESCRIPTION
mktemp() replaces the contents of the string pointed to by template
with a unique filename, and returns the amended template. The string
in template should look like a filename with six trailing X; mktemp()
will replace the X with a character string that can be used to create
a unique filename.
RESULT
mktemp() will assign to template the empty string if it cannot create
a unique name.
NOTES
mktemp() can create only 26 unique filenames per process for each
unique template.
Between the time a pathname is created and the file opened, it is pos-
sible for some other process to create a file with the same name. The
mkstemp() function avoids this problem.
SEE ALSO
mkstemp(3), tmpfile(3S), tmpnam(3S), stdlib(5).
Page 1 Reliant UNIX 5.44 Printed 11/98