F.38 CreateISAM
Create all the ISAM files.
Short Name
CREISAM
TYPE
ISAM function
DECLARATION
COUNT CreateISAM(pTEXT filnam)DESCRIPTION
CreateISAM opens the parameter file, whose name is pointed to by filnam, and creates the data and index files specified in the parameter file. Application programs using the ISAM level functions must make a call to CreateISAM, 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.
Although it is not recommended, it is possible to use incremental ISAM file opens and creates 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.
RETURN
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
TEXT isam_par[64];printf("\nEnter ISAM parameter file name: ");scanf("%63s",isam_par);if (CreateISAM(isam_par))printf("\n%s files could not be created. (%d %d)",isam_err,isam_fil);if (CloseISAM())printf("\nCould not close ISAM.");if (OpenISAM(isam_par))printf("\nCould not open ISAM.");if (CloseISAM())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, OpenISAM, CreateIFile, OpenIFile, CreateISAMXtd, and the Section 5.9 "ISAM Parameters" on page 5-25 of the c-tree Plus Programmer's Reference Guide, which describes the parameter, file contents.
|
FairCom Corporation www.faircom.com |