Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Int 21h Function 3Dh
 Summary Example                         Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
     Any normal, system, or hidden file with a matching name will be
     opened by this function. If the file is read-only, the success of
     the operation also depends on the access code in bits 0-2 of
     register AL. After opening the file, the file read/write pointer
     is set to offset zero (the first byte of the file).
 
     The function fails if
 
        ■ Any element of the path name does not exist.
        ■ The file is opened with an access mode of read/write and the
          file has the read-only attribute.
        ■ [Version 3.0+] SHARE.EXE is loaded and the file has already been
          opened by one or more other processes in a sharing mode that
          is incompatible with the current program's request.
 
     The file's date and time stamp can be accessed after a successful
     open call with Int 21h Function 57h.
 
     The file's attributes (hidden, system, read-only, or archive) can
     be obtained with Int 21h Function 43h.
 
     When a file handle is inherited by a child process or is
     duplicated with Int 21h Functions 45h or 46h, all sharing and
     access restrictions are also inherited.
 
     [Version 3.0+]
     Bit 3 should always be zero; bits 4-7 control access to the file
     by other programs. Bits 4-6 have no effect unless SHARE.EXE is
     loaded.
 
     [Version 3.0+]
     A file-sharing error causes a critical-error exception (Int 24h)
     with an error code of 02h. Int 21h Function 59h can be used to
     obtain information about the sharing violation.
 
     [Version 4.0+]
     Int 21h Function 6Ch combines the services of Functions 3Ch, 3Dh,
     and 5Bh.
                                    -♦-