Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctscmp - Superfile Compact Utility

Operational Model:

  • Standalone

Usage:

ctscmp <filename> [Options] [Y] [new_sect_size]

Arguments

  • <filename>: The name of the superfile to compact or scan.
  • Options:
    • -resetdistinct: Reset distinct key count attribute in IIDX ikeydup fields.
    • -scanonly: Scan the superfile only; do not compact it. No new superfile will be created. The -scanonly option generates details from the header, extended header, IFIL, and DODA. It outputs the number of key values, active records, deleted records and resource records. Using this utility with the -scanonly option is useful for comparing superfiles before and after compacting them.
    • -aes32: Enable AES encryption with 32 byte key.
    • -aes24: Enable AES encryption with 24 byte key.
    • -aes16: Enable AES encryption with 16 byte key.
    • -cleartext: Disable file encryption.
    • -v11: Allows compatability with V11.
  • Y: An optional parameter; if specified, the utility compacts the file without prompting to confirm (otherwise you will be prompted).
  • <new_sect_size>: An optional sector size of the resulting file (sect*128 = page size) to use for the new superfile. If omitted, the new superfile is created using the same page size as the original superfile.

Description

The superfile compact utility, ctscmp, compacts and rebuilds a superfile and all its members provided the required IFIL resources are present in the superfile data members. It creates a compacted version of the file in place, using a temporary file named CTREE.TMP as a destination and then renaming it.

Use cases for this functionality include eliminating wasted disk space, changing page size or encryption attributes, or repairing problems with an index.

The utility is designed for the Standalone single-user model. It supports processing data and index member names with extensions other than .dat and .idx.

A “% complete” progress indicator has been added to the ctscmp utility.

The ctscmp utility uses a standard error and warning message format. Error messages begin with the text ‘Error:’ and warning messages with the text ‘Warning:’, so errors and warnings can easily be located in the ctscmp output.

The default ctscmp behavior is to preserve existing encryption settings. Options to enable or disable encryption have been added. Working with AES encrypted files requires the correct master password and a master password verification file "ctsrvr.pvf". See Master Password Verification Options.

There is an ISAM-based version of the superfile compact utility named ctscmpi. This version uses ISAM c-tree functions rather than low-level c-tree functions to add records to the new compacted superfile. The advantage of the ISAM approach is that records are indexed as they are added, so the utility does not require a separate rebuild phase to repopulate the indexes as the ctscmp utility does. Using this technique can significantly reduce the time required to compact a superfile.

The ctscmp utility returns a non-zero value when it fails. This can be useful for a script that calls the utility to be able to detect when it fails.

TOCIndex