.\" Copyright (c) 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" %sccs.include.redist.man%
.\" @(#)mktemp.3 8.1 (Berkeley) %G%
.Nd make temporary file name (unique)
.Fn mktemp "char *template"
.Fn mkstemp "char *template"
takes the given file name template and overwrites a portion of it
This file name is unique and suitable for use
The template may be any file name with some number of
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
testing roughly 26 ** 6 combinations.
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
returns a pointer to the template on success and
returns \-1 if no suitable file could be created.
If either call fails an error code is placed in the global variable
to one of the following values:
.Bl -tag -width [ENOTDIR]
The pathname portion of the template is not an existing directory.
to any value specified by the
to any value specified by the