FUNCTION c_getfiles(filespec, file_names, nfiles, maxfiles, first_call, ck_lock)
char *filespec; char file_names[][CMLEN]; long *nfiles; long maxfiles; long first_call; long ck_lock;
Host file name specification for files to find. This file specification may include wild cards.
Array of file names matching the input specification.
The number of files matching the input specification.
The maximum number of files to return.
= TRUE (1): This is the first call to this function. Return the first maxfiles files. = FALSE (0): This is not the first call to this function. Return the next maxfiles files.
= TRUE (1): Return the list of unlocked files only. = FALSE (0): Return the list of all files found.A file is considered locked if another file exists that has the same name except with a "lock" suffix.
This function opens a pipe to the UNIX command "echo filespec" to expand all wildcard characters. The function reads file names from the pipe and returns at most maxfiles file names. If the maximum number of file names is returned, the calling function should repeat the call to c_getfiles() until the list of file names is exhausted. If the list of file names is not exhausted by the calling routine, the pipe will remain open and a defunct process may be left when the program terminates.
c_getfiles() returns
E_SUCC --> Successful completion E_FAIL --> Operation failed