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► ◄Notes► ◄Example► ◄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 pathname does not exist.
- the file is opened with an access mode of read/write and the file has
the read-only attribute.
- [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.
▀ Only bits 0-2 of register AL are significant; the remaining bits should
be zero for upward compatibility.
▀ [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.
▀ [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.
▀ [4.0+] Int 21H Function 6CH combines the services of Functions 3CH,
3DH, and 5BH.
-♦-