Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:docs:dos:api:int21:3d [2021/04/30 03:30] – created prokushev | en:docs:dos:api:int21:3d [2024/05/02 07:55] (current) – prokushev | ||
---|---|---|---|
Line 13: | Line 13: | ||
===== Family API ===== | ===== Family API ===== | ||
+ | [[en: | ||
===== Input ===== | ===== Input ===== | ||
Line 23: | Line 24: | ||
===== Return ===== | ===== Return ===== | ||
- | CF clear if successful | + | CF clear if successful |
AX = file handle | AX = file handle | ||
CF set on error | CF set on error | ||
Line 30: | Line 31: | ||
===== Notes ===== | ===== Notes ===== | ||
- | Notes: | + | file pointer is set to start of file |
- | if SHARE or a network is loaded, the file open may fail if the file | + | |
- | | + | if SHARE or a network is loaded, the file open may fail if the file is already open, depending on the combination of sharing modes (see # |
- | | + | |
- | file handles which are inherited from a parent also inherit sharing | + | file handles which are inherited from a parent also inherit sharing and access restrictions |
- | | + | |
- | files may be opened even if given the hidden or system attributes | + | files may be opened even if given the hidden or system attributes |
- | under the FlashTek X-32 DOS extender, the pointer is in DS:EDX | + | |
- | DR DOS checks the system password or explicitly supplied password at | + | under the FlashTek X-32 DOS extender, the pointer is in DS:EDX |
- | the end of the filename (following a semicolon) against the reserved | + | |
- | field in the directory entry before allowing access | + | DR DOS checks the system password or explicitly supplied password at |
- | sharing modes are only effective on local drives if SHARE is loaded | + | |
- | BUG: | + | the end of the filename (following a semicolon) against the reserved |
- | | + | |
- | | + | field in the directory entry before allowing access |
- | | + | |
+ | sharing modes are only effective on local drives if SHARE is loaded | ||
+ | |||
+ | Novell DOS 7 SHARE v1.00 would refuse file access in the cases in #01403 marked with [1] (read-only open of a read-only file which had previously been opened in compatibility mode); this was fixed in SHARE v1.01 of 09/29/94 | ||
Bitfields for access and sharing modes: | Bitfields for access and sharing modes: | ||
- | Bit(s) | + | |
- | | + | ^ Bit(s) |
- | 000 read only | + | | 2-0 |
- | 001 write only | + | | ::: | 000 read only | |
- | 010 read/ | + | | ::: | 001 write only | |
- | 011 (DOS 5+ internal) passed to redirector on EXEC to allow | + | | ::: | 010 read/ |
- | | + | | ::: | 011 (DOS 5+ internal) passed to redirector on EXEC to allow case-sensitive filenames |
- | | + | | |
- | | + | | 6-4 | sharing mode (DOS 3.0+) (see # |
- | 000 compatibility mode | + | | ::: | 000 compatibility mode | |
- | 001 " | + | | ::: | 001 " |
- | 010 " | + | | ::: | 010 " |
- | 011 " | + | | ::: | 011 " |
- | 100 " | + | | ::: | 100 " |
- | 111 network FCB (only available during server call) | + | | ::: | 111 network FCB (only available during server call) | |
- | | + | | 7 | inheritance |
- | if set, file is private to current process and will not be inherited | + | | ::: | if set, file is private to current process and will not be inherited by child processes |
- | | + | |
(Table 01403) | (Table 01403) | ||
Values of DOS 2-6.22 file sharing behavior: | Values of DOS 2-6.22 file sharing behavior: | ||
- | | | ||
- | | ||
- | | ||
- | |R W RW R W RW R W RW R W RW R W RW | ||
- | - - - - -| - - - - - - - - - - - - - - - - - | ||
- | | ||
- | W |Y Y Y N N N N N N N N N N N N | ||
- | RW|Y Y Y N N N N N N N N N N N N | ||
- | - - - - -| | ||
- | | ||
- | | ||
- | RW|C C C N N N N N N N N N N N N | ||
- | - - - - -| | ||
- | | ||
- | | ||
- | RW|C C C N N N N N N N N N Y N N | ||
- | - - - - -| | ||
- | | ||
- | | ||
- | RW|C C C N N N N N N N N N N Y N | ||
- | - - - - -| | ||
- | | ||
- | | ||
- | RW|C C C N N N N N N N N N Y Y Y | ||
- | Legend: Y = open succeeds, N = open fails with error code 05h | ||
- | C = open fails, INT 24 generated | ||
- | 1 = open succeeds if file read-only, else fails with error code | ||
- | 2 = open succeeds if file read-only, else fails with INT 24 | ||
- | (Table 01404) | + | ^ First Open ^^ Second and subsequent Opens |
+ | ^ ::: ^^ Compat ^^^ Deny All ^^^ Deny Write ^^^ Deny Read ^^^ Deny None ^^^ | ||
+ | ^ ::: ^^ R ^ W ^ RW ^ R ^ W ^ RW ^ R ^ W ^ RW ^ R ^ W ^ RW ^ R ^ W ^ RW ^ | ||
+ | ^ Compat | ||
+ | ^ ::: ^ W | Y | Y | Y | N | N | N | N | N | N | N | N | N | N | N | N | | ||
+ | ^ ::: ^ RW| Y | Y | Y | N | N | N | N | N | N | N | N | N | N | N | N | | ||
+ | ^ Deny All ^ R | C | C | C | N | N | N | N | N | N | N | N | N | N | N | N | | ||
+ | ^ ::: ^ W | C | C | C | N | N | N | N | N | N | N | N | N | N | N | N | | ||
+ | ^ ::: ^ RW| C | C | C | N | N | N | N | N | N | N | N | N | N | N | N | | ||
+ | ^ Deny Write ^ R | 2 | C | C | N | N | N | Y | N | N | N | N | N | Y | N | N | | ||
+ | ^ ::: ^ W | C | C | C | N | N | N | N | N | N | Y | N | N | Y | N | N | | ||
+ | ^ ::: ^ RW| C | C | C | N | N | N | N | N | N | N | N | N | Y | N | N | | ||
+ | ^ Deny Read ^ R | C | C | C | N | N | N | N | Y | N | N | N | N | N | Y | N | | ||
+ | ^ ::: ^ W | C | C | C | N | N | N | N | N | N | N | Y | N | N | Y | N | | ||
+ | ^ ::: ^ RW| C | C | C | N | N | N | N | N | N | N | N | N | N | Y | N | | ||
+ | ^ Deny None ^ R | 2 | C | C | N | N | N | Y | Y | Y | N | N | N | Y | Y | Y | | ||
+ | ^ ::: ^ W | C | C | C | N | N | N | N | N | N | Y | Y | Y | Y | Y | Y | | ||
+ | ^ ::: ^ RW| C | C | C | N | N | N | N | N | N | N | N | N | Y | Y | Y | | ||
+ | |||
+ | Legend: | ||
+ | Y = open succeeds, N = open fails with error code 05h | ||
+ | C = open fails, INT 24 generated | ||
+ | 1 = open succeeds if file read-only, else fails with error code | ||
+ | 2 = open succeeds if file read-only, else fails with INT 24 | ||
+ | |||
Values for DOS 7.x file sharing behavior: | Values for DOS 7.x file sharing behavior: | ||
- | | Second and subsequent Opens | + | |
- | First |Compat | + | ^ First Open ^^ Second and subsequent Opens ^^^^^^^^^^^^^^^^^^^^ |
- | | + | ^ ::: |
- | |R W RW A | + | ^ ::: |
- | - - - - -| - - - - - - - - - - - - - - - - - - - - - - - - | + | ^ Compat |
- | Compat R |Y Y Y Y | + | ^ ::: ^ W | Y | Y | Y | C | N | N | N | N | N | N | N | N | N | N | N | Y | Y | N | N | Y | |
- | W |Y Y Y C | + | ^ ::: ^ RW | Y | Y | Y | C | N | N | N | N | N | N | N | N | N | N | N | Y | Y | N | N | Y | |
- | RW|Y Y Y C | + | ^ ::: ^ NA | Y | C | C | Y | N | N | N | N | Y | N | N | Y | N | N | N | Y | Y | N | N | Y | |
- | NA|Y C C Y | + | ^ Deny All |
- | - - - - -| | + | ^ ::: ^ W | C | C | C | C | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | |
- | | + | ^ ::: ^ RW | C | C | C | C | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | |
- | All | + | ^ ::: ^ NA | C | C | C | C | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | |
- | RW|C C C C | + | ^ Deny Write ^ R | Y | C | C | Y | N | N | N | N | Y | N | N | Y | N | N | N | Y | Y | N | N | Y | |
- | NA|C C C C | + | ^ ::: ^ W | C | C | C | C | N | N | N | N | N | N | N | N | Y | N | N | Y | Y | N | N | Y | |
- | - - - - -| | + | ^ ::: ^ RW | C | C | C | C | N | N | N | N | N | N | N | N | N | N | N | Y | Y | N | N | Y | |
- | | + | ^ ::: ^ NA | Y | C | C | Y | N | N | N | N | Y | N | N | Y | N | N | N | Y | Y | N | N | Y | |
- | Write | + | ^ Deny Read ^ R | C | C | C | C | N | N | N | N | N | Y | N | N | N | N | N | N | N | Y | N | N | |
- | RW|C C C C | + | ^ ::: ^ W | C | C | C | C | N | N | N | N | N | N | N | N | N | Y | N | N | N | Y | N | N | |
- | NA|Y C C Y | + | ^ ::: ^ RW | C | C | C | C | N | N | N | N | N | N | N | N | N | N | N | N | N | Y | N | N | |
- | - - - - -| | + | ^ ::: ^ NA | Y | Y | Y | Y | N | N | N | N | Y | Y | Y | Y | N | N | N | Y | Y | Y | Y | Y | |
- | | + | ^ Deny None ^ R | Y | Y | Y | Y | N | N | N | N | Y | Y | Y | Y | N | N | N | Y | Y | Y | Y | Y | |
- | Read W |C C C C | + | ^ ::: ^ W | C | C | C | C | N | N | N | N | N | N | N | N | Y | Y | Y | Y | Y | Y | Y | Y | |
- | RW|C C C C | + | ^ ::: ^ RW | C | C | C | C | N | N | N | N | N | N | N | N | N | N | N | Y | Y | Y | Y | Y | |
- | NA|Y Y Y Y | + | ^ ::: ^ NA | Y | Y | Y | Y | N | N | N | N | Y | Y | Y | Y | N | N | N | Y | Y | Y | Y | Y | |
- | - - - - -| | + | |
- | | + | |
- | None W |C C C C | + | |
- | RW|C C C C | + | |
- | NA|Y Y Y Y | + | |
Legend: R -> reading, W -> writing, RW -> both reading & writing, | Legend: R -> reading, W -> writing, RW -> both reading & writing, | ||
A/NA -> reading without access time update | A/NA -> reading without access time update | ||
Line 136: | Line 132: | ||
===== See also ===== | ===== See also ===== | ||
- | AH=0Fh, | + | AH=[[en: |
===== Note ===== | ===== Note ===== |