[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson