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.
DelFile
◄Example► ◄Back► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
;* DelFile - Deletes a specified file.
;*
;* Shows: DOS Function - 41h (Delete File)
;*
;* Params: fspec - Pointer to ASCIIZ file specification
;*
;* Return: Short integer with error code
;* 0 if successful
;* 1 if delete error
DelFile PROC \
USES ds, \
fspec:PTR BYTE
LoadPtr ds, dx, fspec ; Point DS:DX to file spec
mov ah, 41h ; DOS Function 41h
int 21h ; Delete File
mov ax, 0 ; Set error code, keep flags
jnc exit ; Exit if successful
inc ax ; Else set error code to 1
exit: ret
DelFile ENDP
-♦-