Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Data and Index File Numbering

Once a file is opened for use it is referred to by its file number. Therefore, each data and index file must be assigned a unique number by the programmer. Data files, index files and index members all draw file numbers from the same pool; therefore, data files and indexes cannot have the same number assigned.

An index member is an index stored in the same physical file with other indexes. The first additional index member in an index file is given a keyno one greater than the keyno of the host index. The second index member in an index file is given a keyno two greater than the host keyno, and so on.

For example, if data file 0 has 4 total indexes (1 primary index and 3 members), the total consumed file numbers would be 5 and would be numbered 0-4 (the primary index would be file number 1).

The maximum number of c-tree files that can be simultaneously opened is controlled by #define MAXFIL found in ctopt2.h, located in the ctree/include directory. MAXFIL also controls the largest file number that may be used. To adjust the define from its default value of 1024, 2048 for client libraries, place the following define in ctoptn.h to override the MAXFIL define.

#define ctMAXFIL 150 /* set the max number of

files to 150 */

Multi-user, non-server implementations using a dummy lock file have additional file numbering constraints. See the Multi-User Concepts chapter of this manual for further details.