Home Search

DriveWorks Pro 22
FsGetFiles

Send Feedback

FsGetFiles

Returns a table of file information for the selected directory or optionally all subdirectories that match the specified file types.

Syntax

FsGetFiles([Directory Location],[Search All Subdirectories],[File Types],[Wait Time])

Where:

Directory Location is the location to check. If this is not a full path then it shall be treated as being relative to the projects location.

Search All Subdirectories is True to search for directories in the current directory and any of its subdirectories. False to only retrieve directories in the current directory. By default this is False.

File Types is a list of file extensions for the types of files to retrieve from the directory. An empty value will retrieve all file types. By default this will be empty.

Wait Time is the maximum time to wait for the check to complete in seconds. After the specified time, if the directory has not been found #IO! Timed Out will be returned.

Note: Do not use to wait for a file to be generated. The Wait Time is the time to wait for the check to complete and not intended to pause the start of the check.

This function will not automatically update. To update the function, one of the arguments must change to re-trigger the function.

Example

Rule

Meaning
FsGetFiles("C:\DriveWorks\Parent Directory",False,"txt|csv",2) This will return the files from the directory C:\DriveWorks\Parent Directory

Subdirectories will not be searched.

Files that exist with the extensions txt and csv will be returned.

If the Parent Directory has not been found after 2 seconds an error will be returned.

Example Outcome

DriveWorks will return the result as an array, which will look like:

Table returned as an Array (headers and rows separated for clarity)

{"Name","Path","Extension","Size (KB)","Date Created";

"BOM 2507","C:\DriveWorks\Parent Directory\BOM 2507.csv",".csv",875.25,"10/31/2017 12:41:37";

"BOM 2507","C:\DriveWorks\Parent Directory\BOM 2507.txt",".txt",467.2,"10/31/2017 12:41:37";

"Cut List 2507","C:\DriveWorks\Parent Directory\Cut List 2507.txt",".txt",780.6,"11/21/2017 09:41:44"}

When viewed in a table, the array will look like:

NamePathExtensionSize (KB)Date Created
BOM 2507C:\DriveWorks\Parent Directory\BOM 2507.csv.csv875.2510/31/2017 12:41:37
BOM 2507C:\DriveWorks\Parent Directory\BOM 2507.txt.txt467.210/31/2017 12:41:37
Cut List 2507C:\DriveWorks\Parent Directory\Cut List 2507.txt.txt780.611/21/2017 09:41:44