Erase any file from disk by low-level access
FERASE( <cFile> ) --> nSuccess
<cFile> Name of file to erase.
<nSuccess> 0 if successful, -1 if not
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.
#include "fileio.ch" IF FErase( "test.txt" ) != F_ERROR ? "File successfully erased" ELSE ? "File can not be deleted" ENDIF
Library is rtl