

tmpnam()                 General Function                tmpnam()




Generate a unique name for a temporary file

#include <stdio.h>
cchhaarr *ttmmppnnaamm(_n_a_m_e);
cchhaarr *_n_a_m_e;

tmpnam constructs  a unique name for a  file.  The names returned
by tmpnam generally are mechanical concatenations of letters, and
therefore  are mostly  used to  name  temporary files,  which are
never seen by the user.  Unlike a file created by tmpfile, a file
named by tmpnam does not automatically disappear when the program
exits.  It must be  explicitly removed before the program ends if
you want it to disappear.

name points  to the buffer  into which tmpnam writes  the name it
generates.  If  name is set to NULL, tmpnam  writes the name into
an internal  buffer that  may be  overwritten each time  you call
this function.

tmpnam  returns a  pointer  to the  temporary  name.  Unlike  the
related function tempnam,  tmpnam assumes that the temporary file
will be  written into directory  /tmp and builds  the name accor-
dingly.

***** Example *****

For an example of this function, see execve.

***** See Also *****

general functions, mktemp(), STDIO, tempnam()

***** Notes *****

If you want  the file name to be written  into buffer, you should
allocate at  least L_tmpnam bytes  of memory for  it; L_tmpnam is
defined in the header stdio.h.



















COHERENT Lexicon                                           Page 1


