OpenISAM Open all the ISAM files. Short Name OPNISAM() Type ISAM function Declaration COUNT OpenISAM(pTEXT filnam) Description OpenISAM() opens the parameter file, whose name is pointed to by filnam, and opens the data and index files specified in the parameter file. Application programs using the ISAM level functions must make a call to InitISAM() or OpenISAM() before any other c-tree Plus functions are used. If any one of these three functions has been called, then CloseISAM() must be called before anyone of them can be invoked again. In part, this implies that no more than one ISAM parameter file may be active at one time. However, the incremental ISAM functions allow for more flexibility in file manipulations and are highly recommended. Using virtual files, the parameter file may contain more files than available file descriptors. c-tree Plus automatically manages the open and close of virtual files. Although it is not recommended, it is possible to use incremental ISAM file opens and opens along with a parameter file. Increase the value of the second parameter in the parameter file, (idxs), by the total number of files used by the incremental routines. For example, if the incremental routines open two additional data files, each with five indices, then the idxs parameter in the ISAM parameter file should be increased by 12. Note: This function supports EXCLUSIVE file opens. For more information, please refer to “Multi-user File Mode”. Return OpenISAM() returns an error code from the table below. On a successful open when a differently named file matches the file ID of an open file, the error return will be NO_ERROR (0) but sysiocod will be set to MFID_COD (-586). If the files are detected to actually be different, then the file ID is changed as discussed above and sysiocod is not set to MFID_COD.
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example TEXT isam_par[64];
scanf("%63s",isam_par);
if (OpenISAM(isam_par)) printf("\nCould not open ISAM.");
else ProcessData()
printf("\nCould not close ISAM.");
Limitations It is not possible to open some of the files specified in the parameter file and create others. They must all be created by CreateISAM(). However, the incremental ISAM functions permit on the fly opening and closing of ISAM files. If you are adding a new index file to an established set of ISAM files, you should:
See also CloseISAM(), InitISAM(), CreateISAM(), CreateIFile(), OpenIFile(), OpenISAMXtd() and “ISAM Parameters” in the c-tree Plus Programmer’s Reference Guide, which describes the parameter file contents. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||