Description
Extracts information about a specified file. The 'Save value to variable' activity appears automatically when choosing the 'File information' activity. It automatically saves the value to a variable. The activity is not mandatory to use and can be removed from the workflow.
Parameters
Path
-
Set a value: enables you to directly write the desired path.
-
Save the previous step result: chooses the previous function result as a path.
-
Calculate a value: enables you to use available properties and methods to form a path.
-
Pick: opens an explorer to select the path manually
Contains an annotation to the activity. The input text will be displayed above the activity name.
Result
The received file information is stored in file_info
variable by default. The variable represents an object with the following keys:
{
"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"
}
Interaction with folders
This activity can interact not only with files, but also with folders. In order to specify the folder path, you need to copy it from the file explorer and paste it manually to the parameter “Path”. Keep in mind that the “Pick” button will not allow you to pick folders.
Usage Examples
This activity 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.