Microsoft Windows CE 3.0  

DeleteFile

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function deletes an existing file from a file system. It can also delete an unmounted database volume. A remote application interface (RAPI) version of this function exists, and it is named CeDeleteFile.

BOOL
DeleteFile(
LPCTSTR
lpFileName
);

Parameters

lpFileName
[in] Pointer to a null-terminated string that specifies the file or database volume to be deleted.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

If an application attempts to delete a file that does not exist, the DeleteFilefunction fails.

Use the RemoveDirectoryfunction to delete a directory.

The DeleteFilefunction fails if an application attempts to delete a file that is open for normal I/O or as a memory-mapped file.

To close an open file handle, use the CloseHandlefunction.

To unmount a database volume, use the CeUnmountDBVolfunction.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winbase.h   Coredll.lib, Fsmain.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CeDeleteFile, CeUnmountDBVol, CloseHandle, CreateFile, GetLastError, RemoveDirectory, CeUnmountDBVol