List Files in Directories
  • 10 Jan 2023
  • 1 Minute to read
  • Dark
    Light

List Files in Directories

  • Dark
    Light

Article summary

Step Details

Introduced in Version3.0.0
Last Modified in Version8.0.0
LocationFile Management

The List Files in Directory step will list all files found in a directory or its subdirectories. The step requires the full path to the directory as an input and will output the full path to the file.


Properties

Inputs

PropertyDescriptionData Type
Directory NameThe name of the directory, including its full path.String

Outputs

PropertyDescriptionData Type
OutputOutputs 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 Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step List Files In Directory 1[ListFilesInDirectory] in flow [Testing Flow]: Exception invoking method ListFilesInDirectory on class FileSteps ---> DecisionsFramework.LoggedException: Exception invoking method ListFilesInDirectory on class FileSteps ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\Decisions\Decisions Server\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)
   at DecisionsFramework.Design.Flow.CoreSteps.StandardSteps.FileSteps.ListFilesInDirectory(String directoryName) 
   --- 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?