_FCreate( ) API Library Routine Example

The following example uses _FCreate( ) to create a number of files using the various mode flags of _FCreate( ).

Visual FoxPro Code

SET LIBRARY TO FCREATE 

C Code

#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
{
   FCHAN fchan;

   fchan = _FCreate("normal.tmp", FC_NORMAL);
   _FClose(fchan);

   fchan = _FCreate("readonly.tmp", FC_READONLY);
   _FClose(fchan);

   fchan = _FCreate("hidden.tmp", FC_HIDDEN);
   _FClose(fchan);

   fchan = _FCreate("system.tmp", FC_SYSTEM);
   _FClose(fchan);

   fchan = _FCreate("temp.tmp", FC_TEMPORARY);
   _FClose(fchan);

   fchan = _FCreate("multi.tmp", FC_SYSTEM | FC_READONLY);
   _FClose(fchan);
}

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