GINO Graphics Suite - GINO v9.0  

gGetDirList

Syntax

[C/C++:]
int gGetDirList(int *n, char *names[], int flen);
[F90:]
integer function gGetDirList(n, names)

integer, intent(inout) :: n
character*(*), intent(out) :: names(*)

Arguments

n
Input - Size of names array Output - Number of entries in names

names
List of file names

flen
Maximum length of filename including terminating NULL (C/C++ only)

Description

The system utility gGetDirList() returns a simple list of file names in the current directory. The input value of the argument n specifies the maximum number of files to be returned (ie. indicating the size of the names array), but on return, n will be set to the actual number of files returned which may be less than or equal to the input value.

The function returns a non zero value if the operation was not successful for any reason and zero if successful.

In the C/C++ binding, space must be allocated for the required number of file names prior to calling this routine. This is achieved by declaring an array of length n of character pointers (the address of which is passed to this function) and allocating space for each file name using malloc, the address of which is placed in the character array. The space allocated for each file name should be equal to flen * sizeof(char). In both bindings, if the individual file names are larger than the width of the character array, the names will be truncated.

A more comprehensive utility is provided by gGetFullDirList() if more information is required about files and their attributes.

See Also

gGetDirList Usage
gGetFullDirList