Test for errors after a binary file operation

     FERROR() --> nErrorCode


     FERROR() returns the DOS error from the last file operation as an
     integer numeric value.  If there is no error, FERROR() returns zero.

     FERROR() Return Values
     Error   Meaning
     0       Successful
     2       File not found
     3       Path not found
     4       Too many files open
     5       Access denied
     6       Invalid handle
     8       Insufficient memory
     15      Invalid drive specified
     19      Attempted to write to a write-protected disk
     21      Drive not ready
     23      Data CRC error
     29      Write fault
     30      Read fault
     32      Sharing violation
     33      Lock Violation


     FERROR() is a low-level file function that indicates a DOS error after a
     file function is used.  These functions include FCLOSE(), FCREATE(),
     FERASE(), FOPEN(), FREAD(), FREADSTR(), and FRENAME().  FERROR() retains
     its value until the next execution of a file function.

     Warning!  This function allows low-level access to DOS files and
     devices.  It should be used with extreme care and requires a thorough
     knowledge of the operating system.


     .  This example tests FERROR() after the creation of a binary
        file and displays an error message if the create fails:

        #include "Fileio.ch"
        nHandle := FCREATE("Temp.txt", FC_NORMAL)
        IF FERROR() != 0
           ? "Cannot create file, DOS error ", FERROR()

 Files   Library is CLIPPER.LIB.



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.