Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

PutIFile

Place an IFIL structure into a data file resource record.

Short Name

PUTIFIL()

Type

ISAM resource function

Declaration

VRLEN PutIFile(pIFIL ifilptr)

Description

Place a new, or replace an existing file definition (consisting of IFIL, IIDX and ISEG structures) into the resource record of the data file pointed to by ifilptr.

Normally, the IFIL is placed in the file during CreateIFile(). PutIFile() allows this resource to be updated or a new IFIL structure to be placed in files created with other functions.

Return

Value

Symbolic Constant

Explanation

0

NO_ERROR

Successful IFIL retrieval.

107

IDRK_ERR

Too many keys defined for data file.

401

RNON_ERR

Resources not enabled.

See c-tree Error Codes for a complete listing of valid c-tree error values.

Refer to the following sections for additional details regarding IFIL structures.

IFIL Structure

IIDX Structure

ISEG Structure

Example

IFIL vc_dat = {

. . . .

}; /* IFIL structure to be placed in resource record */


VRLEN ret=0; /* function return work variable */


if (ret=PutIFile(&vc_dat))

printf("\nError during PUTIFIL(), error = %d",ret);

else

printf("\nSuccessful PUTIFIL()!");

Limitations

The file must be closed prior to calling this function. PutIFile() opens the file in ctEXCLUSIVE mode and closes the file upon return.

See also

OpenFileWithResource(), GetIFile(), CreateIFile(), PutIFileXtd()

TOCIndex