Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

DELIFILX

Delete ISAM file and associated indexes to the recycle bin.

Type

ISAM function

Declaration

COUNT DELIFILX(pIFIL ifilptr)

Description

DELIFILX() deletes the file and indexes referenced by the incremental ISAM structure pointed to by ifilptr to a recycle bin, if and only if the file and indexes have been opened in exclusive mode.

The file is closed following a successful call to DELIFILX(). After a successful call to DELIFILX(), the tfilno member of the IFIL structure is set to -1.

Return

Value

Symbolic Constant

Explanation

0

NO_ERROR

Successful file deletion.

55

DLTF_ERR

File could not be deleted. Does any process have the file open?

56

DLTP_ERR

File is not opened in the ctEXCLUSIVE mode. Delete is not performed.

See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.

Example

pIFIL ifilptr;


if (OpenIFile(ifilptr)

printf("\nCould not open data file or index, error = %d,

file = %d",isam_err,isam_fil);

else if (DELIFILX(ifilptr)

printf("\nCould not delete data file or index, error = %d,

file = %d",isam_err,isam_fil);

Limitations

DELIFILX() calls the Low-Level DELFILX() function, which first closes the file before deletion.

This permits another process to have a small window of opportunity to gain control of the file in which case the delete will fail and result in an error DLTF_ERR (55).

See also

DeleteRFile, DeleteCtFile, DeleteIFile, DELFILX, and DELRFILX

TOCIndex