Retrieve information from a file header.
A variety of information about a file is stored in the file header. However, in c-tree Plus the header is not directly accessible. GetCtFileInfo() can be used to access certain items of information from the header of file filno. Use mode to specify the type of information to be returned. The following values can be used for mode:
ALIGNM
|
Returns a value signifying the alignment of field types. If a record schema resource, or DODA, exists for the file the schema alignment is returned. If no schema exists, but the file header has a non-zero alignment setting, this value is returned; otherwise the system alignment is returned.
Note: This mode requires a call across the network for client/server systems. For efficiency, store the values in the client application after the initial call rather than calling every time the information is needed.
|
BEGBYT
|
Returns the first possible location for a data record in a data file. If filno is a member of a superfile, GetCtFileInfo() returns the position of the last record added to the file. If filno is an index, GetCtFileInfo() returns -1 and uerr_cod is set to FMOD_ERR (48). The position returned is not necessarily an active data record: it may be a resource or a deleted record.
|
EXTSIZ
|
Returns the current file extension size.
|
FILDEF
|
Returns a bit mask which specifies file related c-tree Plus specifications at the time the file was created. The existing bit masks are:
DEF_MASK_IFIL2 - extended IFIL structures
DEF_MASK_SPCMGT - superfile space management
DEF_MASK_PSCL24 - Pascal string definition
DEF_MASK_XTDPRM - extended permission mask
The same note for ALIGNM applies to client/server applications.
|
FILEID
|
Returns the c-tree sequence number of the 12-byte Unique file ID assigned to each file at creation. The ID is comprised of a server ID, a time stamp and a sequence number, each 4-bytes long.
|
FILMOD
|
Return the file mode value.
|
FILTYP
|
Return DATA_FILE (0) for a fixed-length data file, INDX_FILE (1) for an index file, or VDAT_FILE (2) for a variable-length data file.
|
FRSACTPRT
|
Returns the first active parition number for a file.
|
KEYDUP
|
Returns 0 if the index only allows unique key values, or non-zero if it permits duplicates.
|
KEYLEN
|
Return key length (valid only for key files).
|
KEYMEM
|
Returns a small integer indicating the index member number. A zero means that filno is the host index. The first additional member is number 1, and so on.
|
KEYPAD
|
Returns the byte value checked for trailing padding compression.
|
KEYTYP
|
Returns the key type.
|
LSTACTPRT
|
Returns the last active parition number for the file.
|
LOGSIZ
|
Return the logical file size in bytes. The logical file size represents the number of bytes that are taken up by actual data records, including deleted records. Not applicable to superfile members.
|
NKYMEM
|
Returns the number of index members contained in filno.
|
NODSIZ
|
Returns the index node size.
|
PERMSK
|
Returns a file’s permission mask (Server only).
|
PHYSIZ
|
Return the physical file size in bytes. The physical size is the actual size of the file, including deleted records and file extension space not yet used. Not applicable to superfile members.
|
RECLEN
|
Return data record length (valid only for data files).
|
RELKEY
|
Returns the relative key number (zero based) for the index with respect to its associated data file.
|
REVMAP
|
Returns the data file number associated with the key filno (ISAM only).
|
SERVID
|
Returns the c-tree Server ID of the 12-byte Unique file ID assigned to each file at creation. The ID is comprised of a server ID, a time stamp and a sequence number, each 4-bytes long.
|
SUPTYP
|
Returns the superfile type of filno. NON_SUPER (0) is not a superfile. HST_SUPER (1) is superfile host. MBR_SUPER (2) is a superfile member. IDX_SUPER (6) is a superfile directory member.
|
TIMEID
|
Returns the c-tree time stamp of the 12-byte Unique file ID assigned to each file at creation. The ID is comprised of a server ID, a time stamp and a sequence number, each 4-bytes long.
|
UPDFLG
|
Returns the current corrupt, or update, flag for the file, such as:
0x00 Ok
0x4C Rebuild index. Loop in leaf node links
0x52 Opened with ctOPENCRPT and file was corrupt
0x63 File compacted. Rebuild indices
0xFF Corrupt
|
The return value depends on the mode used in the function call. The value returned is based on the mode selected. A value of -1L means that uerr_cod contains an error.
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values.