DirectoryList()
Lists the directory and returns the list of files under it as array or query
DirectoryList( path=string, recurse=boolean, listInfo=string, filter=any, sort=string, type=string );
Returns: any
| Argument | Description |
|---|---|
|
path
string,
required
|
edit
The absolute path of the directory to list the content from. This can be any type of supported Virtual File Systems Alias: absolute_path, absolutePath |
|
recurse
boolean,
optional
|
edit
Specifies whether to include subdirectories in the listing. If |
|
listInfo
string,
optional
|
edit
Defines the return type of this function:
|
|
filter
any,
optional
|
edit
Specifies a filter to be used to filter the results:
|
|
sort
string,
optional
|
edit
Query columns by which to sort a directory listing. To use sort, "listInfo" must be set to "query"! Delimited list of columns from query output. Sorting is case sensitive. To qualify a column, use one of the following values:
|
|
type
string,
optional
|
edit
type of the result returned:
|
Examples
editTo return an array of file paths that end with the substring .log from a the directory /var/data:
directoryList("/var/data", false, "path", function(path){ return arguments.path.hasSuffix(".log"); })