FairCom Corporation


F.98 EnableCtResource


Enable Resources in a file created without resources enabled.

Short Name

ENARES

TYPE

Low-level file function

DECLARATION

COUNT EnableCtResource(COUNT filno)

DESCRIPTION

When creating a file with CreateISAM, CreateIFile, CreateIndexFile, or CreateDataFile, resources can be disabled for that file using the ctDISABLERES file mode. To later use resources with that file, call EnableCtResource to enable that feature before calling AddCtResource, PutIFIL, or PutDODA.

The file must already be open, and it must be opened with a file lock mode of ctEXCLUSIVE. Otherwise, you will receive an error. filno is the file number for the affected file.

RETURN

Value
Symbolic Constant
Explanation
0
NO_ERROR
Successful Resource enable.
400
RCRE_ERR
Resources already enabled for this file.
402
RXCL_ERR
filno has not been opened with an ctEXCLUSIVE lock.

See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.

EXAMPLE

pIFIL ifilptr;
if (OpenIFile(ifilptr))
printf("\nCannot open file, error %d",isam_err):
else {
if (EnableCtResource(ifilptr->tfilno))
printf("\nCannot enable resource,err%d", uerr_cod);
else (PutIFIL(ifilptr))
printf("\nCannot add resource,err%d", isam_err);
CloseFile(ifilptr->tfilno,0);
}

SEE ALSO

AddCtResource, PutDODA, and PutIFile.


FairCom Corporation
www.faircom.com