Previous
Index
Next
INT 21 - DOS 4.0+ - EXTENDED OPEN/CREATE AX = 6C00h BL = open mode as in AL for normal open (see also AH=3Dh) bit 7: inheritance bits 4-6: sharing mode bit 3 reserved bits 0-2: access mode 100 read-only, do not modify file's last-access time (DOS 7.0) BH = flags bit 6 = auto commit on every write (see also AH=68h) bit 5 = return error rather than doing INT 24h bit 4 = (FAT32) extended size (allow 4GB files instead of 2GB) CX = create attribute (see #01769) DL = action if file exists/does not exist (see #01770) DH = 00h (reserved) DS:SI -> ASCIZ file name CF should be set on entry for better compatibility Return: CF set on error AX = error code (see #01680 at AH=59h/BX=0000h) CF unchanged, AL = 00h as DOS v1 style error (AX = 6C00h) CF clear if successful AX = file handle CX = status (see #01768) Notes: the PC LAN Program only supports existence actions (in DL) of 01h, 10h with sharing=compatibility, and 12h DR DOS reportedly does not support this function and does not return an "invalid function call" error when this function is used. (see the note below on DOS v1 style error.) DR-DOS v5 and v6 report DOS version 3.31 so it follows they do not support this function. the DR-DOS v7 family (Novell DOS, Caldera DR-DOS, OpenDOS, Enhanced DR-DOS) do support this function. the documented bits of BX are stored in the SFT when the file is opened (see #01641,#01642) DOS v1 style error sets AL = 00h (thus AX = 6C00h) but leaves CF unchanged so it is good practice to initialise CF set before the int 21h call MS-DOS v4.01 and lDOS accept bit 0 in DH set, all other bits must be zero or an error 0001h is generated MS-DOS v4.01 and lDOS accept any value in AL BUGS: this function has bugs (at least in DOS 5.0 and 6.2) when used with drives handled via the network redirector (INT 2F/AX=112Eh): - CX (attribute) is not passed to the redirector if DL=11h, - CX does not return the status, it is returned unchanged because DOS does not pass CX from calling the redirector back to the user stack frame (fixed in lMS-DOS on 2024-05-01). SeeAlso: AH=3Ch,AH=3Dh,AX=6C01h,AX=7160h/CL=00h,INT 2F/AX=112Eh (Table 01768) Values for extended open function status: 01h file opened 02h file created 03h file replaced Bitfields for file create attribute: Bit(s) Description (Table 01769) 6-15 reserved 5 archive 4 reserved 3 volume label 2 system 1 hidden 0 readonly Bitfields for action: Bit(s) Description (Table 01770) 7-4 action if file does not exist 0000 fail 0001 create 3-0 action if file exists 0000 fail 0001 open 0010 replace/open