Table of Contents
Note: This API call is for DOS and Win16 personality only. Use Family API for portability.
Int 21H, AH=41H
Version
2 and higher
Brief
“UNLINK” - DELETE FILE
Family API
Input
AH = 41h DS:DX -> ASCIZ filename (no wildcards, but see notes) CL = attribute mask for deletion (server call only, see notes)
Return
CF clear if successful
AX destroyed (DOS 3.3) AL seems to be drive of deleted file CF set on error AX = error code (02h,03h,05h) (see #01680 at AH=59h/BX=0000h)
Notes
(DOS 3.1+) wildcards are allowed if invoked via AX=5D00h, in which case the filespec must be canonical (as returned by AH=60h), and only files matching the attribute mask in CL are deleted
DR DOS 5.0-6.0 returns error code 03h if invoked via AX=5D00h; DR DOS 3.41 crashes if called via AX=5D00h with wildcards
DOS does not erase the file's data; it merely becomes inaccessible because the FAT chain for the file is cleared
deleting a file which is currently open may lead to filesystem corruption. Unless SHARE is loaded, DOS does not close the handles referencing the deleted file, thus allowing writes to a nonexistant file.
under DR DOS and DR Multiuser DOS, this function will fail if the file is currently open
under the FlashTek X-32 DOS extender, the pointer is in DS:EDX
BUG: DR DOS 3.41 crashes if called via AX=5D00h
See also
Note
Text based on Ralf Brown Interrupt List Release 61
osFree Macro Library | |
---|---|
Video I/O | @SetMode @SetCurSz @SetCurPos @GetCur @SetPage @ScrollUp @ScrollDn @Scroll @GetChAtr @PutChAtr @PutCh @SetPalet @SetColor @SetDot @GetDot @WrtTTY @VideoState @GetMode @GetDisplay @GetVideoState @GetEGAInfo @Cls |
Hardware info | @Equipment @MemSize |
Serial I/O | @AuxInit @AuxSendChar @AuxRecieveChar @AuxStatus |
Tape I/O | @TapeOn @TapeOff @TapeRead @TapeWrite |
Keyboard I/O | @KbdStatus @CharIn @CharPeek |
Printer I/O | @PrnPrint @PrnInit @PrnStatus |
Disk I/O | @DskReset @DskStatus @DskRead @DskWrite @DskVerify @DskFormat |
Date and Time | @SetTime @GetTime |
Mouse | @MouInit @MouShowPointer @MouStatus @MouSetPos @MouSetMickey @MouRegion |
Memory manager | @ModBlok SET_BLOCK |