Platform SDK: Win32 API |
Deletes the given file or files. If the specified filename contains a wildcard character, this function can delete multiple files that match the wildcard.
mov ax, 7141h ; Delete File mov ch, MustMatchAttrs ; see below mov cl, SearchAttrs ; see below mov dx, seg Filename ; see below mov ds, dx mov dx, offset Filename mov si, WildcardAndAttrs ; see below int 21h jc error
Value | Meaning |
---|---|
_A_NORMAL (0000h) | The file can be read from or written to. This value is valid only if used alone. |
_A_RDONLY (0001h) | The file can be read from, but not written to. |
_A_HIDDEN (0002h) | The file is hidden and does not appear in an ordinary directory listing. |
_A_SYSTEM (0004h) | The file is part of the operating system or is used exclusively by it. |
_A_VOLID (0008h) | The name specified by Filename is used as the volume label for the current medium. |
_A_SUBDIR (0010h) | The name specified by Filename is used as a directory, not a file. |
_A_ARCH (0020h) | The file is an archive file. Applications use this value to mark files for backup or removal. |
_A_NORMAL (0000h)
_A_RDONLY (0001h)
_A_HIDDEN (0002h)
_A_SYSTEM (0004h)
_A_VOLID (0008h)
_A_SUBDIR (0010h)
_A_ARCH (0020h)
Value | Meaning |
---|---|
0 | Wildcard characters are not allowed in Filename. Any specified attributes are ignored. |
1 | Wildcard characters are allowed in Filename. Files with specified attributes are matched. |
Clears the carry flag if successful. Otherwise, the function sets the carry flag and sets the AX register to an error value.
Wildcard searches are more flexible in Windows 95/98 than in MS-DOS. Both long filenames and aliases are considered in searches. For example, *1 finds Windows 95/98 filenames (both long filenames and aliases) that end in a 1 and *mid* finds filenames that contain the characters mid. In MS-DOS and in Windows 95/98 searching on real-mode FAT directories, all characters after the first * are ignored.
For more information about how MustMatchAttrs and SearchAttrs are used, see the comments for Find First File (Interrupt 21h Function 714Eh).