

            dopen$ (6) --- open a disk file                          07/04/83


          | _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 integer function dopen$ (path, fd, mode[, typ[, limit]])
                 character path (ARB)
                 integer mode, typ, limit
                 file_des fd

                 Library:  vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Dopen$'  is an internal Subsystem routine that performs the
                 function of 'open' for disk files only.  The first  argument
                 is  the pathname of the file to be opened; it must be an EOS
                 terminated  string  (i.e.   dopen$('/dir/file1's....).   The
                 second  argument is the file descriptor assigned to the file
                 in 'open'.  The third argument is the mode, READ,  WRITE  or
                 READWRITE.   The  fourth argument is optional.  It specifies
                 the type of the file.  The fifth argument  is  optional;  it
                 specifies  the number of times to retry the open if the file
                 is in use.  'Dopen$'  returns  the  value  of  'fd'  if  the
                 attempt  to  open was successful; ERR if the attempt failed.
                 The user is always left  in  the  home  directory  after  an
                 attempt to open.

                 By   default,  'dopen$'  returns  a  file  descriptor  to  a
                 sequential access method (SAM) file.  If creating  a  direct
                 access method file (DAM) is desired, the 'mode' argument may
                 be  ORed with the KNDAM file key (i.e., 'mode' can be "READ-
                 WRITE+KNDAM" to create a DAM  file  opened  for  reading  or
                 writing).    The   constant   KNDAM   is  contained  in  the
                 "PRIMOS_KEYS" include file.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 'Dopen$' calls 'getto'  to  reach  the  UFD  containing  the
                 desired  file  and  pack the filename into an array suitable
                 for use with Primos routines.  If 'getto' is successful, the
                 Primos subroutine SRCH$$ is called to  open  the  file.   If
          |      either  'getto'  or SRCH$$ fails, Primos AT$HOM is called to
          |      return the user to the home directory, and ERR  is  returned
                 as the function value of 'dopen$'.


            _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

                 typ


            _C_a_l_l_s

          |      getto,  Primos  at$hom, Primos missin, Primos srch$$, Primos
          |      sleep$



            dopen$ (6)                    - 1 -                    dopen$ (6)




            dopen$ (6) --- open a disk file                          07/04/83


            _S_e_e _A_l_s_o

                 open (2)























































            dopen$ (6)                    - 2 -                    dopen$ (6)


