DosForceDelete

Removes a file name from a directory. The deleted file is not recoverable.

Syntax
DosForceDelete (pszFile)

Parameters

 * pszFile (PSZ) - input : Address of the name of the file to be deleted.

Return Code

 * ulrc (APIRET) - returns:DosForceDelete returns one of the following values:
 * 0 NO_ERROR
 * 2 ERROR_FILE_NOT_FOUND
 * 3 ERROR_PATH_NOT_FOUND
 * 5 ERROR_ACCESS_DENIED
 * 26 ERROR_NOT_DOS_DISK
 * 32 ERROR_SHARING_VIOLATION
 * 36 ERROR_SHARING_BUFFER_EXCEEDED
 * 87 ERROR_INVALID_PARAMETER
 * 123 ERROR_INVALID_NAME
 * 206 ERROR_FILENAME_EXCED_RANGE

Remarks
Global file-name characters are not permitted in the name of the file to be deleted.

Read-only files cannot be deleted by DosForceDelete. To delete a read-only file, you must first issue DosSetFileInfo to change the file's read-only attribute to zero, then delete the file.

The deleted file cannot be recovered with the UNDELETE command. You may want to issue DosForceDelete to delete a temporary file that you would not want to recover.

DosForceDelete cannot be used to delete directories. Issue DosDeleteDir to delete a directory.

Example Code
This example creates a read-only file named "DOSFDEL.DAT", it then changes the file attributes. DosForceDelete is used to delete this file so it is not possible to restore it using UNDELETE.

Related Functions

 * DosDelete
 * DosDeleteDir
 * DosSetFileInfo