home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / ixemul-39.47-env-bin.lha / man / cat3 / mktemp.0 < prev    next >
Text File  |  1993-12-07  |  3KB  |  67 lines

  1.  
  2. MKTEMP(3)                  UNIX Programmer's Manual                  MKTEMP(3)
  3.  
  4. NNAAMMEE
  5.      mmkktteemmpp - make temporary file name (unique)
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<uunniissttdd..hh>>
  9.  
  10.      _c_h_a_r _*
  11.      mmkktteemmpp(_c_h_a_r _*_t_e_m_p_l_a_t_e)
  12.  
  13.      _i_n_t
  14.      mmkksstteemmpp(_c_h_a_r _*_t_e_m_p_l_a_t_e)
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      The mmkktteemmpp() function takes the given file name template and overwrites a
  18.      portion of it to create a file name.  This file name is unique and suit­
  19.      able for use by the application.  The template may be any file name with
  20.      some number of `Xs' appended to it, for example _/_t_m_p_/_t_e_m_p_._X_X_X_X. The
  21.      trailing `Xs' are replaced with the current process number and/or a
  22.      unique letter combination.  The number of unique file names mmkktteemmpp() can
  23.      return depends on the number of `Xs' provided; six `Xs' will result in
  24.      mmkktteemmpp() testing roughly 26 ** 6 combinations.
  25.  
  26.      The mmkksstteemmpp() function makes the same replacement to the template and
  27.      creates the template file, mode 0600, returning a file descriptor opened
  28.      for reading and writing.  This avoids the race between testing for a
  29.      file's existence and opening it for use.
  30.  
  31. RREETTUURRNN VVAALLUUEESS
  32.      The mmkktteemmpp() function returns a pointer to the template on success and
  33.      NULL on failure.  The mmkksstteemmpp() function returns -1 if no suitable file
  34.      could be created.  If either call fails an error code is placed in the
  35.      global variable _e_r_r_n_o.
  36.  
  37. EERRRROORRSS
  38.      The mmkktteemmpp() and mmkksstteemmpp() functions may set _e_r_r_n_o to one of the follow­
  39.      ing values:
  40.  
  41.      [ENOTDIR]  The pathname portion of the template is not an existing direc­
  42.                 tory.
  43.  
  44.      The mmkktteemmpp() and mmkksstteemmpp() functions may also set _e_r_r_n_o to any value
  45.      specified by the stat(2) function.
  46.  
  47.      The mmkksstteemmpp() function may also set _e_r_r_n_o to any value specified by the
  48.      open(2) function.
  49.  
  50. SSEEEE AALLSSOO
  51.      chmod(2),  getpid(2),  open(2),  stat(2)
  52.  
  53. HHIISSTTOORRYY
  54.      A mmkktteemmpp function appeared in Version 7 AT&T UNIX.
  55.  
  56. BSD Experimental                April 19, 1991                               1
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.