Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.3 . Guide To CA-Clipper - <b>ferase()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FERASE()
 Delete a file from disk
------------------------------------------------------------------------------
 Syntax

     FERASE(<cFile>) --> nSuccess

 Arguments

     <cFile> is the name of the file to be deleted from disk, including
     extension, optionally preceded by a drive and/or path specification.

 Returns

     FERASE() returns -1 if the operation fails and zero if it succeeds.  In
     the case of a failure, FERROR() can be used to determine the nature of
     the error.

 Description

     FERASE() is a file function that deletes a specified file from disk.
     FERASE() is the same as the ERASE command but returns a value and can be
     specified within an expression.  When FERASE() is called, <cFile> is
     deleted from disk only if found in the current DOS directory or in the
     directory explicitly specified as part of the file name.  Like the other
     file functions and commands, FERASE() does not use either SET DEFAULT or
     SET PATH to locate <cFile>.

     Warning!  Files must be CLOSEd before removing them with FERASE().

 Examples

     .  This example deletes a set of files matching a wildcard
        pattern:

        #include "Directry.ch"
        AEVAL(DIRECTORY("*.BAK"), { |aFile| ;
           FERASE(aFile[F_NAME]) })

     .  This example erases a file and displays a message if the
        operation fails:

        IF FERASE("AFile.txt") == -1
           ? "File erase error:", FERROR()
           BREAK
        ENDIF

 Files   Library is CLIPPER.LIB.


See Also: CLOSE ERASE FERROR() FRENAME() RENAME

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson