Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Four Byte File Numbering TypeDef Change

FairCom V12 and later servers support opening more than 32,767 files. This enhancement has been designed so no application changes should be required. Each individual database connection is still limited to a maximum of 32,767 files (preserving the original definition of data and index file numbers as two-byte signed values, using the COUNT data type). Internally, a new four byte typedef was introduced supporting up to 2 billion files. Note that there is a compile-time limit of 1,000,000 files to reduce the memory footprint of the c-tree database engine. If you need more than 1,000,000 open files, please contact FairCom.

However, if opening many files, consider the possibility of using multiple FairCom DB engines to host the files, rather than having one FairCom DB engine hosting all the files. This is recommended as files compete for resources such as data and index cache, file system cache, operating system kernel memory, and transaction logs.

New FILNO typedef

The data type FILNO replaces COUNT in all API functions that specify a FairCom DB file number as input or output. When code is compiled with #define ctFeatMAXFILE32, FILNO evaluates to a 4-byte value. When ctFeatMAXFILE32 is off, FILNO evaluates to a 2-byte value as before. Likewise, the IFIL structure's dfilno and tfilno fields become 4-byte values when ctFeatMAXFILE32 is defined.

In addition, the global state variable isam_fil remains a two byte value (COUNT). isam_fil32 holds the four byte value (FILNO) in case of errors.

See Also

Millions of Open Files