4.3BSD-UWisc/man/cat3/mktemp.3

Compare this file to the similar file:
Show the results in this format:




MKTEMP(3)           UNIX Programmer's Manual            MKTEMP(3)



NAME
     mktemp - make a unique file name

SYNOPSIS
     char *mktemp(template)
     char *template;

     mkstemp(template)
     char *template;

DESCRIPTION
     _M_k_t_e_m_p creates a unique file name, typically in a temporary
     filesystem, by replacing _t_e_m_p_l_a_t_e with a unique file name,
     and returns the address of the template.  The template
     should contain a file name with six trailing X's, which are
     replaced with the current process id and a unique letter.
     _M_k_s_t_e_m_p makes the same replacement to the template but
     returns a file descriptor for the template file open for
     reading and writing.  _M_k_s_t_e_m_p avoids the race between test-
     ing whether the file exists and opening it for use.

SEE ALSO
     getpid(2), open(2)

DIAGNOSTICS
     _M_k_s_t_e_m_p returns an open file descriptor upon success.  It
     returns -1 if no suitable file could be created.




























Printed 12/27/86          May 14, 1986                          1