List Files in Directory By Extension
- 10 Jan 2023
- 1 Minute to read
- Print
- DarkLight
List Files in Directory By Extension
- Updated on 10 Jan 2023
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Step Details | |
Introduced in Version | 4.0.0 |
Last Modified in Version | 7.12.0 |
Location | File Management |
The List Files in Directory By File Extension will list all files in a directory or subdirectory. However, the step will list only files with a specific file extension.
Properties
Inputs
Property | Description | Data Type |
---|---|---|
Directory Name | The name of the directory including its full path. | String |
Ext | The file extension used for filtering. | String |
Outputs
Property | Description | Data Type |
---|---|---|
Output | Outputs a list of all files found within the directory and its subdirectories | List of Strings |
Common Errors
Unable to locate Directory. Directory does not exist
By default, Decisions will search for the directory starting from C:\Program FIles\Decisions directory. To ensure the directory can be located, include the full file path to the directory for the Directory Name input.
Exception Message:
Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step List Files In Directory By Extension 1[ListFilesInDirectoryByExtension] in flow [Testing Flow]: Exception invoking method ListFilesInDirectoryByExtension on class FileSteps ---> DecisionsFramework.LoggedException: Exception invoking method ListFilesInDirectoryByExtension on class FileSteps ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\Decisions\examples'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at System.IO.Directory.GetFiles(String path, String searchPattern, EnumerationOptions enumerationOptions)
at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.ListFilesInDirectoryByExtension(String directoryName, String ext)
--- End of inner exception stack trace ---
at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data)
at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData)
at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData)
--- End of inner exception stack trace ---
Was this article helpful?