GetDirectoryList

Files
Aptilis 1

GetDirectoryList(DestinationArrayName[][, Filter])

getDirectoryList will fill the specified array with all the sub-directory names of the current directory.
The optional filter allows to get a list of directories restricted to, for example, directories that start with a given letter. The rules that apply to the filter are the same as the ones that apply to match and this is an aptilis implementation, not a system one, so that the behaviour of the filter functions is identical across the various platforms Aptilis runs on.
Note that both '.' and '..' are returned.
You can check which directory you're in with getCurrentDirectory and change to another directory with changeDirectory.
The array specified is emptied before the directories may be searched.

Return Value:
The number of directories found and the directories names in the specified array.

Example:

chdir("c:\\windows")
n = getdirectorylist(dl[])

for i=0 to n - 1

print(dl[i]$, "\n")

end for
Result:
.
..
system
command
config
system32
See also: getFileList, getCurrentDirectory, changeDirectory.