FairCom Corporation


F.94 DeleteRFile


Delete ISAM file and associated indices.

Short Name

DELRFIL

TYPE

ISAM function

DECLARATION

COUNT DeleteRFile(COUNT datno)

DESCRIPTION

DeleteRFile deletes the file and indices referenced by the ISAM data file with file number datno, if and only if the file and indices have been opened in exclusive mode.

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 Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.

EXAMPLE

COUNT datno = 5;
TEXT filnam[15];
printf("\nEnter file name to delete:")
scanf("%14s", filnam);
if (OpenFileWithResource(datno, filnam, ctEXCLUSIVE))
printf("\nCould not open data file or index, error = %d,
file = %d",isam_err,isam_fil);
else if (DeleteRFile(datno))
printf("\nCould not delete data file or index, error = %d,
file = %d",isam_err,isam_fil);

LIMITATIONS

DeleteRFile calls the low-level DeleteCtFile function, which first closes the file before deletion.

In a non-server model, 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

DeleteIFile, which deletes files based on incremental ISAM structures.


FairCom Corporation
www.faircom.com