Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctfchk - File Checksum Utility

ctfchk is a standalone c-tree utility that calculates the checksum on all active records in a fixed-length c-tree data file. It reads active records from a fixed-length c-tree data file in physical order and outputs a checksum and active record count. The utility uses the CRC-32 algorithm to compute the checksum.

This utility can be used to compare the record contents of two fixed-length data files. Two c-tree data files that contain the same active record images in the same order will generate identical checksums. Two c-tree data files whose active record contents differ will generate different checksums (subject to the limitations of the CRC-32 algorithm).

Operational Model:

  • Standalone

Usage

ctfchk <filename> [-skpchk] [-logcrc] [-logbyt]

[-logrec <record number>] [-opencrpt]

Where:

  • -logcrc - Output the current CRC after each active record is read.
  • -logbyt - Output the offset of each active record.
  • -logrec <record_number> - Output the contents of the specified record. The first active record in the file in physical order is record 1.
  • -opencrpt - Permits the utility to open a file whose update flag is set.

When the file is already opened by another instance (Server, for instance), trying to open it to calculate the checksum will fail with error FCRP_ERR (14, File Corrupt at Open). If the -opencrpt option is added, the utility tries to open the file using the ctOPENCRPT filemode. If this second open attempt succeeds, the utility outputs the following message and proceeds to calculate the checksum of all active records in the file:

NOTE: This file's update flag is set. Opened file using ctOPENCRPT mode.

TOCIndex