C5_FCLOSE

 FCLOSE()
 Close an open binary file and write DOS buffers to disk
------------------------------------------------------------------------------
 Syntax

     FCLOSE(<nHandle>) --> lError

 Arguments

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

 Returns

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

 Description

     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.

 Examples

     .  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()
        ENDIF

 Files   Library is CLIPPER.LIB.

See Also: FCREATE() FERROR() FOPEN()



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.