C5_FERASE

 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



One response to “C5_FERASE

  1. Pingback: C5_RENAME | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.