Directory | Searches a specified directory and provides files, matching a specific search-pattern. |
The Directory Node is used to iterate over files located in the specified directory (Path). The ventuz:// scheme is also supported as Path and you can use it to search only within the current project folder structure without the need to know the absolute path of the project.
E.g. ventuz://images would restrict the search on the Images folder of the active project. This also works in Runtime when started with a VPR file - in that case all images exported to the VPR would be listed.
The URI output property returns the URI to a file in the directory that matches the SearchPattern. You can iterate to the next file via the Next method.
If the AutoUpdate property is activated, a separate thread will be started in the background to check the directory every 100ms for any changes. As an alternative, the Update method can be triggered to check for changes manually.
The SearchPattern is directly based to the .NET framework and therefore follows the syntax described in MSDN: Directory.GetFiles Method. Two wildcard characters are supported, ? to match exactly zero or one character and * to match zero or more characters. The SearchPattern must not contain two periods followed by a directory separator (i.e. ..\). Subfolder defines whether to include the subfolders in the search.
Examples for SearchPattern:
*.txt data/image*.jpg
The properties SortMode and SortBy allow sorting of the results by Name, Path, Date, Size of the found file items.
Most of the Sort modes are self-explanatory but Natural Sort is worth explaining.
Here is a simple example:
Image1 Image2 Image3 ... Image10 Image11 Image12
A normal sort would result in
Image1 Image10 Image11 Image12 Iamge2 Image3...
whereby a natural sort sorts it in a way a human would expect it
Image1 Image2 Image3 ... Image10 Image11 Image12
Natural Sorting depends on the System Language and therefore can differ from one System to another.
You may choose to search the folder asynchronously with the ASync flag. When done the node will either fire the Loaded or Failed event depending on the result of the search.
The output property ResultArray returns a string array containing all found file URLs. This property can be used for manual iteration (see Array Indexer Node). If no matching files have been found, the array will be empty.