

            mktemp (2) --- create a temporary file                   03/23/80


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 file_des function mktemp (mode)
                 integer mode

                 Library:  vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Mktemp'  is  used  to  make  a  temporary file.  The single
                 parameter is an i/o mode (WRITE  or  READWRITE).   The  tem-
                 porary file is created in directory =temp=, so write permis-
                 sion  in  the  home  directory  is  not  required.  'Mktemp'
                 returns a file descriptor if the temporary was  successfully
                 created, ERR otherwise.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 'Mktemp'  consists  of a loop that calls 'create' to attempt
                 the creation of files with names of the form  "=temp=/tm?*",
                 where "?*" represents a string of decimal digits.  If such a
                 file can be created, 'mktemp' returns a file descriptor that
                 can be used to access it; otherwise, ERR is returned.


            _C_a_l_l_s

                 encode, create


            _S_e_e _A_l_s_o

                 rmtemp (2), close (2), create (2), open (2)























            mktemp (2)                    - 1 -                    mktemp (2)


