tteemmppnnaamm() -- General Function (libc)

Generate a unique name for a temporary file
#iinncclluuddee <ssttddiioo.hh>
cchhaarr *tteemmppnnaamm(_d_i_r_e_c_t_o_r_y, _n_a_m_e);
cchhaarr *_d_i_r_e_c_t_o_r_y, *_n_a_m_e;

tteemmppnnaamm() constructs  a unique temporary  name that can  be used to  name a
file.  _d_i_r_e_c_t_o_r_y points to the name  of the directory in which you want the
temporary  file written.   If this  variable is  NULL, tteemmppnnaamm()  reads the
environmental  variable  TTMMPPDDIIRR  and  uses  it  for _d_i_r_e_c_t_o_r_y.  If  neither
_d_i_r_e_c_t_o_r_y nor TTMMPPDDIIRR is given, tteemmppnnaamm() uses /ttmmpp.

_n_a_m_e points to  the string of letters that will  prefix the temporary name.
This string  should not be more  than three or four  characters, to prevent
truncation  or  duplication of  temporary  file names.   If  _n_a_m_e is  NULL,
tteemmppnnaamm() sets it to tt.

tteemmppnnaamm() uses mmaalllloocc() to allocate a buffer for the temporary file name it
returns.  If all  goes well, it returns a pointer  to the temporary name it
has written.  Otherwise,  it returns NULL if the allocation  fails or if it
cannot build a temporary file name successfully.

_S_e_e _A_l_s_o
lliibbcc, mmkktteemmpp(), TTMMPPDDIIRR, ttmmppffiillee(), ttmmppnnaamm()
