FileTools[ListDirectory] - display the contents of a directory
|
Calling Sequence
|
|
ListDirectory(dir, opt1, opt2, ...)
|
|
Parameters
|
|
dir
|
-
|
path to the directory to be displayed
|
opt1, opt2, ...
|
-
|
(optional) argument of the form option or option=value where option is one of all or returnonly
|
|
|
|
|
Description
|
|
•
|
The ListDirectory(dir) calling sequence returns the contents of the directory dir as a list.
|
•
|
ListDirectory accepts two optional arguments: all and returnonly.
|
|
By default ListDirectory does not display filenames that begin with ".". Specifying the all option makes ListDirectory consider these files as well.
|
|
The string argument is used to select elements from the list of filenames. Only the filenames that match the pattern specified in the string are returned. Patterns of the form defined by StringTools[WildcardMatch] are used.
|
•
|
If dir does not exist, ListDirectory generates an error.
|
•
|
If dir is not a directory, ListDirectory generates an error.
|
•
|
For information on filenames, see file.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
Error, (in listdir) directory does not exist
|
|
|
>
|
|
Error, (in isdir) file or directory does not exist
|
|
|
|
|
Download Help Document
Was this information helpful?