FUNCTION c_getdirs (filespec, dir_names, ndirs, maxdirs, first_call)
char *filespec; char dir_names[][CMLEN]; long *ndirs; long maxdirs; long first_call;
Host file name which specifies the directory in which to search for all subdirectories. If this directory is specified relative to the current working directory, the subdirectory names will be relative to the current working directory as well. If this directory is an absolute path, the subdirectory names will be absolute paths as well.
Array of subdirectory names.
Number of subdirectories found.
Maximum number of subdirectories to return.
= TRUE (1): This is the first call to this function. Return the first maxdirs subdirectories. = FALSE (0): This is not the first call to this function. Return the next maxdirs subdirectories.
Transform the input file specification so that it will match subdirectories below it via the echo command. Create a pipe to store the list of desired directory names. Get the desired number of directory names from the pipe. Close the pipe and return.
NOTE: If the input UNIX directory specification is /sg2/csb/user/mydir/* or /sg2/csb/user/mydir/ then c_getdirs() will return all subdirectories in /sg2/csb/user/mydir/. If the UNIX directory specification is /sg2/csb/user/mydir then c_getdirs() will return all subdirectories in /sg2/csb/user/.
c_getdirs() returns
E_SUCC --> Successful completion E_FAIL --> Operation failed