c_getfiles - Find all of the files that match a given file specification. The file specification may include wild cards.

SYNTAX

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;

PARAMETERS

filespec (char *, input)

Host file name specification for files to find. This file specification may include wild cards.

file_names (char [][CMLEN], output)

Array of file names matching the input specification.

nfiles (long *, output)

The number of files matching the input specification.

maxfiles (long, input)

The maximum number of files to return.

first_call (long, input)

Flag indicating if this is the first call to this function with the given input file specification:

     = 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.

ck_lock (long, input)

Flag indicating if only unlocked files should be returned:

     = 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.

DESCRIPTION

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.

RETURN VALUE

c_getfiles() returns

    E_SUCC --> Successful completion
    E_FAIL --> Operation failed