C and C++ ISAM Programmers Guide

Previous Topic

Next Topic

ctrbldif - IFIL-based Rebuild Utility

A rebuild utility using the IFIL definitions stored in the header of a file:

Operational Model:

  • Client
  • Standalone


ctrbldif DataFileName [ -x8 ] [ -purge ] [ -updifil ] [ -<sectors> ]
[ -temppath=<temporary_path> ] [ -sortmem=<n> ]
[ <UserId> ] [ <UserPassword> ] [ <ServerName> ]


ctrbldif reads the IFIL structure from DataFileName and calls RebuildIFileXtd() to rebuild DataFileName and its associated indexes.

  • -purge - Purge duplicate records.
  • -updifil - Update the IFIL resource within the data file.
  • -sortmem=<N> - Use N KB of memory for sorting. This option can be used to increase the rebuild speed for large files.
  • -x8 - Use extended create blocks read from data and index files.
  • -idxseg=<M>@<S> - If creating index, use M automatic segments of size S. Size is specified in megabytes, or you can specify MB or GB as a suffix. For example: -idxseg=10@1GB
  • -skipdatascan - In V11.5 and later, if you know your datafile is in a good state, you can use this option to skip the initial datafile validity scan for faster rebuilds.
  • -callback - In V11.5 and later: When used with a c-treeACE Server this will provide additional feedback on the rebuild progress.

    c-treeACE Standalone Options

  • -temppath= - directory path, <temporary_path>, to create temporary sort and purged record files. (This standalone option is the equivalent of the TMP_PATH server configuration option.) The default location is the current directory.
  • -<sectors> - sector size, <sectors>. (in multiples of 128). The sector parameter is especially useful if you need to adjust a file’s PAGE_SIZE (index node size) to match the c-treeACE Server. c-treeACE standalone models default to 16 sectors (2048 byte node size) while the c-treeACE Server defaults to 64 sectors (8192 bytes).

    c-treeACE Server Options

  • <UserID> : client user name to logon to a c-treeACE Server.
  • <UserPassword> : client user password to authenticate to a c-treeACE Server.
  • <ServerName> : c-treeACE Server name for a client to connect.

Environment Variable to Enable Advanced Encryption

In V11.5 and later, c-tree supports enabling advanced encryption at run time using an environment variable. Set the environment variable CTREE_ADVANCED_ENCRYPTION to YES to enable advanced encryption if it is supported. This environment variable can be used to allow c-tree utilities to enable advanced encryption even if they haven't been updated yet to automatically enable advanced encryption when needed. Examples include the rebuild and compact utilities, ctrbldif and ctcmpcif.

Note: If c-tree does not support advanced encryption and this environment variable is set, the c-tree initialization will fail.


  • Even without the -x8 option, some extended create block settings such as the huge file, extended header, and 6-byte transaction number options, are always applied to new files.
  • This option requires all associated index files that are referenced in the data file's IFIL structure to exist, as the utilities use OpenIFile() to open the data file and all associated index files to read the extended create block values.
  • When an application calls the standalone version of the Xtd8 file compact or rebuild functions (for example, CMPIFILX8() or RBLIFILX8()), index files created by the compact or rebuild no longer have the 6-byte transaction number attribute enabled if the specified extended create block's x8mode field has the ctNO6BTRAN bit set.
  • A rebuild or compact will fail with the new error code TFLN_ERR (943) when a client library that supports the new rebuild or compact option format attempts to use this feature with a c-treeACE Server that does not support this new format.

See Also: