Close an open binary file and write DOS buffers to disk

     FCLOSE(<nHandle>) --> lError


     <nHandle> is the file handle obtained previously from FOPEN() or


     FCLOSE() returns false (.F.) if an error occurs while writing;
     otherwise, it returns true (.T.).


     FCLOSE() is a low-level file function that closes binary files and
     forces the associated DOS buffers to be written to disk.  If the
     operation fails, FCLOSE() returns false (.F.).  FERROR() can then be
     used to determine the reason for the failure.  For example, attempting
     to use FCLOSE() with an invalid handle returns false (.F.), and FERROR()
     returns DOS error 6, invalid handle.  See FERROR() for a complete list
     of error numbers.

     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 uses FCLOSE() to close a newly created binary
        file and displays an error message if the close fails:

        #include "Fileio.ch"
        nHandle := FCREATE("Testfile", FC_NORMAL)
        IF !FCLOSE(nHandle)
           ? "Error closing file, error number: ", 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.