Previous Topic

Next Topic

GetSymbolicNames

Retrieve symbolic information about file.

Short Name

GETNAM()

Type

Low-level function

Declaration

COUNT GetSymbolicNames(COUNT filno, pTEXT nambuf, VRLEN buflen, COUNT mode);

Description

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:

  • DEXTNAM - return the data file extension.
  • IEXTNAM - return the index file extension.
  • FILNAM - return the name of the file.
  • MIRNAM - return the name of the mirror file.
  • FRSFLD - return the first r-tree data field symbolic name.
  • LSTFLD - return the last r-tree data field symbolic name.
  • IDXNAM - return the r-tree index symbolic name.
  • OWNNAM - return the file owner’s user ID (Server only).
  • GRPNAM - return the file owner’s group ID (Server only).
  • FILPTH - returns the LOCAL_DIRECTORY or SERVER_DIRECTORY path setting (Server only).
  • WRKDIR - return the server's working directory (Server only).
  • SRVNAM - return the server name (Server only).
  • FIRST_ITEM - with filno = -1, returns the first item in the APP_NAME_LIST definition by the c-tree Server with. If buflen is too small, VBSZ_ERR (153) is returned.
  • NEXT_ITEM - with filno = -1, returns the next item in the APP_NAME_LIST definition by the c-tree Server. Error INOT_ERR (101) is returned when the list of names is exhausted.

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

NO_ERROR

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 4 items are the probable causes of the INOT_ERR (101).

  • Passing GetRecord() a duplicate allowed index number (keyno). GetRecord() does not support duplicate allowed indices.
  • Improper target padding. Review “Key Segment Modes” in the c-tree Plus Programmer’s Guide.
  • Not calling TransformKey() on target. Refer to “TransformKey” in the Function Reference Guide
  • Improper segment mode. Review “Key Segment Modes” in the c-tree Plus Programmer’s Guide.

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 Plus Error Codes for a complete listing of valid c-tree Plus error values.

Example

COUNT filnum;
TEXT  buffer[128];

if (GetSymbolicNames(filnum,buffer,128L,FILNAM) == NO_ERROR)
    printf("\nFile Name is %s",buffer);

See also

GetCtFileInfo()