#include "ciflib.h"
int cifReadFile(const char *fileName,
const char *dicDataBlockName)
cifReadFile reads the named file and optionally performs data integrity checks on this file with respect to the named validation dictionary. Normally, cifInit is called to read the DDL and build the schema into which a dictionary can be loaded. A CIF dictionary is then read using cifReadFile and specifying the DDL as the validation dictionary. Data files are then read using cifReadFile specifying as an argument the CIF dictionary to be used for integrity processing. After integrity processing has been performed, the internal representation of the input file is saved in an auxiliary file. Auxiliary files are stored in a concealed directory .ciflib within the directory containing the input file. The auxiliary file will be used by CIFLIB in all future accesses of the input file if its modification date is more recent than the input file.
fileName | path name of input file |
dicDataBlockName | name of the data block containing the validation dictionary |
Returns 1 if the function could successfully parse the input file, or 0 if an unrecoverable parsing error occurs. Even if the file is successfully parsed, warning and error messages may exist which can be examined using the routines described in Section 2.14. cifInit returns the following additional codes:
CIF_ALLOCATION_FAILURE | memory allocation error |
CIF_NOT_EXIST | missing DDL file |
CIF_OPERATION_DISALLOWED | miscellaneous error |
CIF_OPERATION_PERMISSION_DENIED | file permission error |
See also: | cifInit |
---|---|
cifSaveFile | |
cifCloseFile | |
cifWriteFile | |
cifWriteDataBlock |