home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3s / tmpfile.z / tmpfile
Encoding:
Text File  |  2002-10-03  |  3.1 KB  |  67 lines

  1.  
  2.  
  3.  
  4. TTTTMMMMPPPPFFFFIIIILLLLEEEE((((3333SSSS))))                                                        TTTTMMMMPPPPFFFFIIIILLLLEEEE((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      tmpfile - create a temporary file
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssttttddddiiiioooo....hhhh>>>>
  13.  
  14.      FFFFIIIILLLLEEEE ****ttttmmmmppppffffiiiilllleeee ((((vvvvooooiiiidddd))));;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _t_m_p_f_i_l_e creates a temporary file, and returns a corresponding FILE
  18.      pointer.  The file is created on the temporary directory indicated by the
  19.      string PPPP____ttttmmmmppppddddiiiirrrr in <_s_t_d_i_o._h>.  However, if the variable TTTTMMMMPPPPDDDDIIIIRRRR is
  20.      provided in the user's environment, the variable's value is the name of
  21.      the desired temporary-file directory.  If the directory specified by the
  22.      variable TTTTMMMMPPPPDDDDIIIIRRRR is not accessible, the directory specified by the string
  23.      PPPP____ttttmmmmppppddddiiiirrrr in <_s_t_d_i_o._h> will be used.
  24.  
  25.      If the file cannot be opened, a NULL pointer is returned.  Upon return
  26.      from _t_m_p_f_i_l_e, you may print an error message using _p_e_r_r_o_r(3C), to
  27.      determine the reason for the failure.  A success call to _t_m_p_f_i_l_e will
  28.      create a temporary file just long enough to obtain the FILE pointer, then
  29.      delete the file with _u_n_l_i_n_k(_2), and finally return the FILE pointer to
  30.      the calling process.  Thus, the only means of accessing the temporary
  31.      file is though the FILE pointer.  The file is opened for update ("w+").
  32.  
  33.      Although the name of the temporary file is generated similarly to those
  34.      produced by _t_m_p_n_a_m(3S), _t_m_p_f_i_l_e uses its own algorithm to generate
  35.      filenames similar to, but unique from, those generated by _t_m_p_n_a_m.  This
  36.      allocates the entire space of _t_m_p_n_a_m-generated names to applications
  37.      code. (See _t_m_p_n_a_m(3S) for more information.)
  38.  
  39. EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  40.      _TTTT_MMMM_PPPP_DDDD_IIII_RRRR
  41.           If the environment variable TTTTMMMMPPPPDDDDIIIIRRRR is provided, it is used as the
  42.           desired temporary-file directory. The support for the TTTTMMMMPPPPDDDDIIIIRRRR
  43.           environment variable is introduced in IRIX 6.5.9.
  44.  
  45. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  46.      creat(2), unlink(2), fopen(3S), mktemp(3C), perror(3C), stdio(3S),
  47.      tmpnam(3S).
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.