GetSymbolicNames
Retrieve symbolic information about file.
Short Name
GETNAM()
Type
Low-Level function
Declaration
COUNT GetSymbolicNames(FILNO filno, pTEXT nambuf, VRLEN buflen, COUNT mode);
Description
In V12 the file number typedef was formally changed from COUNT, a two-byte value to FILNO, a four-byte value. Refer to this link for compatibility details. Four Byte File Numbering s
GetSymbolicNames() accesses items of information relating to file filno. Use mode to specify the type of information to return in nambuf. The following values can be used for mode:
FILNAM |
0 |
Return the name of the file. |
FRSFLD |
1 |
Return the first r-tree data field symbolic name. |
LSTFLD |
2 |
Return the last r-tree data field symbolic name. |
IDXNAM |
3 |
Return the r-tree index symbolic name. |
MIRNAM |
4 |
Return the name of the mirror file. |
OWNNAM |
5 |
Return the file owner’s user ID (Server only). |
GRPNAM |
6 |
Return the file owner’s group ID (Server only). |
DEXTNAM |
7 |
Return the data file extension. |
IEXTNAM |
8 |
Return the index file extension. |
Modes >= 128 do NOT require a valid file number
GETNAMsyswide |
128 |
|
WRKDIR |
128 |
Return the server's working directory (Server only). - server's working directory. |
FILPTH |
129 |
Returns the LOCAL_DIRECTORY (or the deprecated SERVER_DIRECTORY) path setting (Server only). File path modifier. |
MIRPTH |
130 |
Mirrored file path modifier. |
SRVNAM |
131 |
Return the server name (Server only). |
FIRST_ITEM |
132 |
With filno = -1, returns the first item in the APP_NAME_LIST definition by the FairCom Server with. If buflen is too small, VBSZ_ERR (153) is returned. |
NEXT_ITEM |
133 |
With filno = -1, returns the next item in the APP_NAME_LIST definition by the FairCom Server. Error INOT_ERR (101) is returned when the list of names is exhausted. |
ctNODEID |
134 |
Server node ID for replication. |
ctREPLVER |
135 |
Server replication support version. |
CURTIME |
136 |
(V11 and later) Retrieve the current server time expressed as the number of seconds since 01/01/1970. This was implemented for a 4-byte buffer. |
CURTIMETM |
137 |
(V11 and later) Retrieve the current server time in the local time (timezone, daylight, etc). This mode retrieves a buffer of ctTM time, which is similar to the regular "struct tm" type. |
ctREPLOPTS |
138 |
Replication configuration options. |
BASEDIR |
139 |
Server's base directory. |
READONLYSERVER |
140 |
Server read only attribute (y/n). |
SERVERROLE |
141 |
Server's role in cluster. |
REPLSYNCMODE |
142 |
Is replication in sync mode |
The ctTM structure is as shown below:
typedef struct cttm {
LONG tm_sec;
LONG tm_min;
LONG tm_hour;
LONG tm_mday;
LONG tm_mon;
LONG tm_year;
LONG tm_wday;
LONG tm_yday;
LONG tm_isdst;
} ctTM;
Return
The return value will be NO_ERROR (0) if no error has occurred. The information will be returned in nambuf. Otherwise, an error code will be returned.
Value |
Symbolic Constant |
Explanation |
---|---|---|
0 |
CTDBRET_OK |
Successful operation. |
22 |
FNUM_ERR |
filno out of range: 0 <= filno < fils, where fils is 2nd parameter. This error may occur if c-tree Plus has not been initialized. |
26 |
FACS_ERR |
File number (datno, keyno, or filno) is not in use. Typically, a file handle is invalid. |
101 |
INOT_ERR |
Could not satisfy and ISAM search request for index isam_fil. This error frequently indicates "End of File" reached, or "Record not Found." The following items are the probable causes of the INOT_ERR (101).
|
116 |
IMOD_ERR |
Bad mode parameter. |
153 |
VBSZ_ERR |
Buffer in call to ReReadVRecord() is too small for the variable-length record. |
See c-tree Error Codes for a complete listing of valid c-tree error values.
Example
FILNO filnum;
TEXT buffer[128];
if (GetSymbolicNames(filnum, buffer, 128L, FILNAM) == NO_ERROR)
printf("\nFile Name is %s",buffer);
See also
GetCtFileInfo()