List Folder
- Updated2023-02-17
- 3 minute(s) read
List Folder
Returns two arrays of strings listing the names of all files and folders found in the specified path.
This node filters both arrays based upon pattern and filters the file names array based upon the specified datalog type.

Inputs/Outputs

datalog
An input that restricts the filenames returned to datalog files containing records of the specified data type. Datalog records contain a time stamp cluster and a cluster of panel data. This input can accept any data type.

path
Path to the folder whose contents you want this node to return.
If path points to a folder that does not exist, file names and folder names return empty arrays, and this node returns an error.

error in
Error conditions that occur before this node runs.
The node responds to this input according to standard error behavior.
Default value: No error

pattern
A string containing special characters that this node uses to restrict the files displayed. pattern does not restrict the directories displayed.
Default value: *.*
Definitions of Special Characters
The pattern matching used by this node is similar to the matching used in matching wildcards. A wildcard is a keyboard character such as an asterisk (*) or a question mark (?) that you can use in place of one or more characters when you search for files. Use wildcards in place of one or more characters when you do not know what the real character is or you do not want to type the entire name.
Characters behave as described in the following table.
Character | Meaning | Example |
---|---|---|
? | Matches any single character. | If you enter multi?.doc, this node locates the file multi1.doc or multis.doc but not multiply.doc. |
* | Matches any sequence of zero or more characters. | If you enter *.html;*.doc, this node locates all files with the extensions .doc or .html. |
; | Separates patterns, allowing you to specify multiple allowable patterns. Do not insert whitespace following this character because this node interprets whitespace literally. | If you enter multi.doc;multiply.doc this node locates both the file multi.doc and multiply.doc. |
All other characters, including white space | Matches the exact character. | If you enter multi.doc, this node only locates the file multi.doc. |

path out
path unchanged.

file names
An array containing the names of the files found in the specified directory.
This node does not return the names of files found in folders within the directory. This node sorts the returned file names alphabetically.

folder names
An array that contains the names of the folders found in the specified directory.
This node sorts the folder names alphabetically. If no path is wired to this node, folder names contains the names of the drives on the computer.

error out
Error information.
The node produces this output according to standard error behavior.