This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS
Note: This is legacy API call. It is recommended to use 32-bit equivalent
This call removes a directory entry associated with a file name.
DosDelete (FileName, Reserved)
rc (USHORT) - return
Return code descriptions are:
Global file name characters are not permitted.
A file whose read-only attribute is set cannot be deleted. To change the setting of the read-only bit, call DosSetFileMode.
#define INCL_DOSFILEMGR USHORT rc = DosDelete(FileName, Reserved); PSZ FileName; /* File name path */ ULONG 0; /* Reserved (must be zero) */ USHORT rc; /* return code */
This example deletes a file in the current directory named test.dat.
#define INCL_DOSFILEMGR #define FILE_DELETE "test.dat" #define RESERVED 0L USHORT rc; rc = DosDelete(FILE_DELETE, /* File path name */ RESERVED); /* Reserved (must be zero) */
EXTRN DosDelete:FAR INCL_DOSFILEMGR EQU 1 PUSH@ ASCIIZ FileName ;Filename path name string PUSH DWORD 0 ;Reserved (must be zero) CALL DosDelete
Returns WORD
Text based on http://www.edm2.com/index.php/DosDelete_(FAPI)