Skip to content

Get File Info

The Get File Info node retrieves detailed information about a specified file path, returning components such as directory, file name, extension, and parent folders.

Purpose

Use this node to:

✅ Parse and extract file path details for downstream processing.
✅ Dynamically derive file names, extensions, or directory structures within automation workflows.
✅ Validate file paths and retrieve their hierarchical context for logging or conditional operations.

Inputs

Field LabelInput TypeDescription
File PathTextThe full or relative file path to retrieve information from.

Outputs

Output VariableDescription
FullPathThe absolute full path of the file.
DirectoryThe directory containing the file.
FileNameThe file name including its extension.
BaseNameThe file name without its extension.
ExtensionThe file extension (including the dot).
ParentFoldersA list of parent folders up the directory tree, ordered from immediate parent upwards.

Functionality

This node:

  1. Validates required input (File Path).
  2. Parses the file path to extract:
    • Full absolute path.
    • Containing directory.
    • File name with extension.
    • Base file name without extension.
    • File extension.
    • A list of parent folders up the directory hierarchy.
  3. Removes the original input key from taskParameters.data for cleanliness.
  4. Returns all extracted data in the outputs for use in subsequent tasks.

Example Use Case

✅ Extract a file’s base name to use as a database key.
✅ Determine a file’s extension to validate processing eligibility.
✅ Retrieve parent directories to build dynamic archive or logging paths.

Task Success Criteria

  • Success: File information is parsed successfully and output variables are set.
  • Failure: If input validation fails or an unexpected error occurs, the task returns a descriptive error message indicating the failure point.

Notes

  • The ParentFolders output returns a list ordered from immediate parent up to the root.
  • The FullPath is resolved using Path.GetFullPath, ensuring absolute path resolution even if a relative path is provided.

Tentech 2024