FERASE()
Erase any file from disk by low-level access
Syntax
FERASE( <cFile> ) --> nSuccess
Arguments
<cFile> Name of file to erase.
Returns
<nSuccess> 0 if successful, -1 if not
Description
This function deletes the file specified in <cFile> from the disk. No extensions are assumed. The drive and path my be included in <cFile>; neither the SET DEFAULT not the SET PATH command controls the performance of this function. If the drive or path is not used, the function will look for the file only on the currently selected directory on the logged drive.
If the function is able to successfully delete the file from the disk, the value of the function will be 0; otherwise a -1 will be returned. If not successfull, additional information may be obtained by calling the FERROR() function.
Note: Any file to be removed by FERASE() must still be closed.
Examples
#include "fileio.ch" IF FErase( "test.txt" ) != F_ERROR ? "File successfully erased" ELSE ? "File can not be deleted" ENDIF
Compliance
Clipper
Files
Library is rtl
Seealso
Pingback: Harbour All Functions – F | Viva Clipper !
Pingback: Harbour Files and Folders Functions | Viva Clipper !
Pingback: Harbour RG Summary | Viva Clipper !