JavaScript Editor js editor     Web development 

Main Page

Terminates access to a file.

int _FClose(FCHAN chan)
FCHAN chan;               /* File channel of file to close. */


Any buffers that have been modified while the buffer is open are automatically flushed to disk. If the file has the TEMPORARY attribute, FClose( ) deletes the file. _FClose( ) returns 0 if the file is closed successfully, or – 1 if the file isn't closed successfully.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.


The following example creates a file Temp.txt, sets its size to 8196 bytes, and closes it using _FClose(В ).

Visual FoxPro Code

В Copy Code
DIR temp.txt

C Code

В Copy Code
#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
   FCHAN fchan = _FCreate("temp.txt", FC_NORMAL);
   _FCHSize(fchan, 8196);

FoxInfo myFoxInfo[] = {
   {"FCHSIZE", (FPFI) Example, CALLONLOAD, ""},
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo

See Also

JavaScript Editor js editor     Web development