Previous Topic

Next Topic

CloseRFile

Incremental ISAM close for files opened by Resource IFIL open.

Short Name

CLRFIL()

Type

ISAM function

Declaration

COUNT CloseRFile(COUNT filno)

Description

CloseRFile() closes the data file filno, and all associated indices, opened by OpenFileWithResource().

Return

Value

Symbolic Constant

Explanation

0

NO_ERROR

Successful close of ISAM files.

22

FNUM_ERR

File number out of range.

24

FCLS_ERR

Could not close file number isam_fil.

401

RNON_ERR

Resources not enabled.

408

RNOT_ERR

IFIL structure not stored in data file resource.

438

DZRO_ERR

File definition block is empty.

See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values.

Example

COUNT    myfile;
COUNT    retval;

if (retval = InitISAM(6,7,4))
    printf("\nCould not close files. Error %d.", retval);
else {
    if (myfile = OpenFileWithResource(-1, "sample.dat", 0))
        printf("\nCould not open files.");
    else if (CloseRFile(myfile))
        printf("\nCould not close files.");

if (CloseISAM())
        printf("\nCould not close ISAM.");
}

See also

InitISAM(), CreateIFile(), OpenFileWithResource()