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
FindFileByName opcode |
Explanation |
ctFILWCDfind |
start new search |
ctFILWCDfindnext |
find next file |
ctFILWCDfindclose |
terminate current search |
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();