FindFileByName Finds a file in the filesystem given a name. Declaration ctCONV NINT ctDECL FindFileByName(pTEXT infilnam,NINT opcode,pTEXT outfilnam,pVRLEN poutfillen); Short Name ctFILWCD() Description This function allows file searches using the wildcard characters ‘?’ and ‘*’. The ‘?’ identifies a single character wildcard position while a ‘*’ specifies any number of characters.
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. Result
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example pseudocode #define MAX_SIZE 1024 /* 1K buffer size */ ... int ListLength = MAX_SIZE pText pFilelist; pFileList = (pText) malloc (sizeOf(pText) * MAX_SIZE);
memset(pFileList, 0, MAX_SIZE); if ((rc = ctFILWCD (“jrnl*.dat”, ctFILWDfindfirst, pFilelist, ListLength)) != 0 ) {
printf(“ctFILWCD did not execute successfully (%d).\n, rc”); } ... Limitations ctFILWCD() does not translate path separators between client and server and does not provide a way to re-read the name of a file if the specified buffer is too small to hold the entire filename. |
|||||||||||||||||