File information

Description

Extracts information about a specified file. The 'Save value to variable' block appears automatically when choosing the 'File information' function. It automatically saves the value to a variable. The block is not mandatory to use and can be removed from the workflow.

Parameters

  1. Set a value: enables you to directly write the desired path.

  2. Save the previous step result: chooses the previous function result as a path.

  3. Calculate a value: enables you to use available properties and methods to form a path.

  4. Pick: opens an explorer to select the path manually

Comment

Contains an annotation to the block. The input text will be displayed inside the block above the function name.

Result

The received file information is stored in file_info variable by default. The variable represents an object with the following keys:

Keys and values of an object with the file information
{
"last_write_time": "time of the last write",
"last_access_time": "time of the last access",
"creation_time": "file creation time",
"length": "file size in bytes",
"extension": "file extension",
"name": "file name with the extension"
}

Usage Examples

This function is useful when dealing with a huge number of files in a folder. Suppose we have a folder with files of different extensions and it is required to process files with the ".txt" extension. Then you may use this function to filter the needed files.