Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Huge File Support

FairCom DB provides support for 8-byte addresses for file offsets. This provides a maximum file size of (4GB)2, or more than 16,000,000 terabytes, per file.

FairCom supports huge files in two ways:

  • Huge files - 8-byte offsets as described in this chapter.
  • Segmented files - logical files distributed across multiple physical files, as described in Segmented File Support.

Huge File Basics

The following step-by-step instructions walk you through the process of using huge files in general. Details are added throughout this chapter and an example is included in Huge File Creation Example.

Compatibility Note: Files created with standard ISAM create calls with FairCom DB V9 and later include extended headers including the ctFILEPOS8 and ct6BTRAN attributes by default. This feature can be disabled with the COMPATIBILITY REVERT_TO_V6HDR keyword should this be necessary for backward compatibility. Standalone applications can disable this support by setting the cth6flg global variable to any non-zero value.

  1. Create a library supporting huge files. The default ctHUGEFILE define activates both Huge File and Segmented File support in the FairCom DB client libraries.
  2. Use the Xtd8 creation functions described in Xtd8 File Creation Functions, and further information in c-tree Function Descriptions:
    1. Use the ctFILEPOS8 extended file mode in the XCREblk structure, described later in this chapter.
    2. Create an array of XCREblk structures, one for each physical data and index file to be created.
    3. Create the file(s) using an Xtd8 create function using the XCREblk array.

Note: Any index referencing a data file created using 8-byte file addresses must also use 8-byte file addresses. A ctFILEPOS8 data file requires a ctFILEPOS8 index. A ctFILEPOS8 index supporting duplicate keys must allow for 8-bytes in its key length for the automatic tiebreaker that FairCom DB automatically appends to the key value. See Huge File Creation Example for more details.

The Xtd8 create functions always create Extended files, even if no extended features are requested (unless the ctNO_XHDRS file mode is turned on). Files created with the original API (e.g., CreateIFileXtd()) are in the Standard c-tree format. A c-tree V6 application receives a FVER_ERR (43) when attempting to open an Extended file.

Note: Files are created in ctEXCLUSIVE mode, so you must close and reopen the file after it is created to allow it to be shared. Since files are created in ctEXCLUSIVE mode, this is a convenient time to execute additional configuration functions, such as SetFileSegments() and PutDODA().

In This Section

Huge File Creation Example

Record Offsets Under Huge File Support