Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

SA_WILDCARD

SA ADMIN function to find a file using a wildcard specification.

Declaration

NINT SA_WILDCARD(pTEXT infilnam, NINT mode, pTEXT outfilnam, NINT outfillen)

Description

  • infilnam is the wildcard filename
  • opcode is one of the following:

    FindFileByName opcode

    Explanation

    ctFILWCDfind

    start new search

    ctFILWCDfindnext

    find next file

    ctFILWCDfindclose

    terminate current search

  • outfilnam is the buffer to hold the found filename
  • poutfillen points to the output buffer size

Note: The wildcard logic finds all files matching the wildcard specification — there is no check that the file is a c-tree data or index file. The wildcard logic also finds memory files whose names match the specified filename.

Return

Value

Symbolic Constant

Explanation

0

NO_ERROR

No error occurred.

See c-tree Error Codes for a complete listing of valid c-tree error values.

Example SA ADMIN API pseudocode


#define MAX_SIZE 1024 /* 1K buffer size */

pText pFilelist;

int ListLength = MAX_SIZE


pFileList = (pText) malloc (sizeOf(pText) * MAX_SIZE);

memset(pFileList, 0, MAX_SIZE);


SA_LOGON("ADMIN", "ADMIN", NULL, "FAIRCOMS");

...

if ((rc = SA_WILDCARD("jrnl*.dat", ctFILWDfindfirst, pFilelist, ListLength)) !=0 ) {

ctrt_printf("SA_WILDCARD encountered the following error code(%n):\n", rc);

}

...


SA_LOGOFF();

TOCIndex