Block Group: | Data Services |
Block Icon: |
The List Files block returns a table that lists the contents of a project directory.
For information on using dataflow blocks, see Dataflow.
The following properties of the List Files block can take input and give output.
invoke causes the table to be created. The invoke property works only if enabled is set to TRUE.
enabled specifies whether the List Files block is enabled.
interval specifies how often the table is automatically generated. A value of 0 means that the table is generated on autoRun or invoke only.
autoRun specifies whether the table is generated automatically.
timeout specifies how long the List Files block will attempt to create the table before the request is canceled.
path specifies the directory for which to create a table. You can populate this field by dragging and dropping. For example, to specify the assets folder, drag the assets folder from the Project panel to this field.
To specify the root project node, click in the path property field and then press Enter or Return.
filter specifies a string that file names must include in order to be listed. For example, this string could be a file extension. Directories are not filtered by this property and are always included in the output if mode is All or Directories.
png
.mode specifies whether the output table lists only files, only directories, or both.
The following properties of the List Files block can give output but cannot take input.
loading returns whether the list is currently loading.
output returns a table that lists the contents of the specified directory. The table includes the following fields:
onComplete fires when the table finishes loading.
error returns the error message, if any.
The output table of the List Files block is only one level deep. Therefore, when one of the table records is a directory, the directory is represented with a name, not a table. You can use multiple List Files blocks to retrieve deeper lists.
For the created and modified columns in the output table, you can parse or format the date time serial numbers using a Parse Date Time or Date Format block.
The following image shows an example of the List Files block. In this example, the block returns a table of files in the “Piping” directory whose names contain the string “valve”.