Perform a directory search.

int fileglob(string &array[], string pattern);

The fileglob function returns the number of entries copied into array.

fileglob performs a directory search using pattern.

pattern may contain '*' and '?' as wildcard characters. If pattern ends with a '/', the contents of the given directory will be returned.

Names in the resulting array that end with a '/' are directory names.

The array is sorted alphabetically, with the directories coming first.

The special entries '.' and '..' (for the current and parent directories) are never returned in the array.

If pattern doesn't match, or if you don't have permission to search the given directory, the resulting array will be empty.

See also dlgFileOpen(), dlgFileSave()

Note for Windows users

The directory delimiter in the array is always a forward slash. This makes sure User Language Programs will work platform independently. In the pattern the backslash ('\') is also treated as directory delimiter.

Sorting filenames under Windows is done case insensitively.


string a[];
int n = fileglob(a, "*.brd");

Index Copyright © 2005 CadSoft Computer GmbH