Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

CloseISAM

Close all ISAM files.

Short Name

CLISAM()

Type

ISAM function

Declaration

COUNT CloseISAM()

Description

CloseISAM() closes all the files opened in the current FairCom DB session and frees all memory allocated by that session. If CloseISAM() encounters difficulty closing a file, it tries to close the remaining files. The error code returned by CloseISAM() pertains to the first file that could not be closed.

Before a second FairCom DB session is started with a call to InitCTree(), CreateISAM(), InitISAM() or OpenISAM() can be made, CloseISAM() must be called.

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.

See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.

Example

extern IFIL myfile;

COUNT retval;


if (retval = InitISAM(6,7,4))

printf("\nCould not close files. Error %d.", retval);

else {

if (OpenIFile(&myfile))

printf("\nCould not open files.");


if (CloseISAM())

printf("\nCould not close ISAM.");

}

Limitations

CloseISAM() closes all ISAM files including those opened or created with the incremental ISAM functions.

See also

OpenISAM, CreateISAM, InitISAM, OpenIFile, InitCTree, CreateIFile, CloseIFile

TOCIndex