Product Documentation

c-treeACE V11.0 Update Guide

Previous Topic

Next Topic

ctVerifyFile

This ISAM-level function verifies the total integrity of a c-treeACE data file and its associated index files.

Function Name

NINT ctVerifyFile(pctVFYFIL pvfyfil);

Type

ISAM-level function

Description

  • pvfyfil points to a ctVFYFIL structure (see ctport.h)

typedef struct ctvfyfil {

LONG verson; /* Version of this structure. */

LONG options; /* Which operations to perform. */

LONG errbufsiz; /* Size of optional error message buffer. */

LONG chkkey; /* Index files to check (0=all, 1=first

index in IFIL, 2=second index, etc). */

pTEXT datnam; /* Name of data file to check. */

pTEXT fileword; /* Optional data file password. */

pVFYMSGCBFNC fnmessage; /* Optional message callback function. */

pVFYPRGCBFNC fnprogress; /* Optional progress callback function. */

pVFYERRCBFNC fnerror; /* Optional progress callback function. */

pTEXT errbuf; /* Optional error message buffer. */

} ctVFYFIL, *pctVFYFIL;

An optional callback can be called from the fnprogress structure member.

Supported options

ctVFopenExclusive

Open the files in exclusive mode. Otherwise, the files are opened in read-only mode, allowing other connections to also open the file in read-only mode.

ctVFchkDataOnly

Read the data file in physical order, not checking keys.

ctVFchkDataWithKeys

Read the data file in physical order and check that each index contains the key built from the record image.

ctVFchkIndexInternals

Perform more thorough index validations for unusual problems.

ctVFchkIndexOnly

Read the index file in key order and don't check the key built from the record image.

ctVFchkIndexWithRecord

Read the index file in key order and check that the key built from the record image matches the key in the index.

ctVFchkDeletedSpace

Scan a data files delete stack or space management index verifying each deleted space entry corresponds to a deleted (not active) record.

ctVFYFILspaceStart

Deleted space scan is starting. (for use with a callback)

ctVFYFILspacePct

Deleted space scan in progress, with the pct parameter indicating approximate percent complete. (for use with a callback)

ctVFYFILspaceEnd

Deleted space scan has completed. (for use with a callback)

Note: ctVerifyFile() requires exclusive access to the file (ctVFopenExclusive). The only exception is the ctVFchkDeletedSpace option, which does not require exclusive access.

The source code for the accompanying ctvfyfil utility provides a good example showing how to use the ctVerifyFile() function.

Note: When a user-defined ctVerifyFile() error callback function returns a non-zero error code so that it can cancel the verification operation, ctVerifyFile() returns the c-tree error code and system error code for the error that triggered that call to the error callback function.

See Also

TOCIndex