Previous Topic

Next Topic

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 c-treeACE 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 c-treeACE client libraries.
  2. Use the Xtd8 creation functions described in Xtd8 File Creation Functions, and further information in c-tree Plus 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 c-treeACE 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 Plus format. A c-tree Plus 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().