Get File Information

This activity is employed to retrieve various information about a specific file, such as its
creation date and time, access time, hidden status, modified time, read-only status, size,
size on disk, file type, and user permissions. It's possible to obtain file information from
a shared folder as well, assuming access permissions are granted.

Technical Reference

 

   INPUT

FilePath: This field denotes the path of the folder from which information needs to be retrieved. Alternatively, you can also input a variable here that contains the file path.

 

 

 

 

 

 

 

    MISC

Display Name: Displays the name of the activity. The activity name can also be customized to help in troubleshooting.

SkipOnError: Specify the Boolean value as “True or False.”
True: Continues to execute the workflow irrespective of any error thrown.
False: Stops the workflow if it throws any error.
None: If the option is specified as blank, by default the activity will perform the “False” action.

Version: It specifies the version of the FS automation feature in use

 

 

 

 

 

 

 

 

 

 

 

 

  OUTPUT

AccessTime: This parameter enables you to retrieve the last accessed time of the file. It accepts the "DateTime" data type. The output value will display the accessed date and time in a 12-hour format.

CreatedDateAndTime: This parameter helps you retrieve the "Date and Time" when the folder was created. It accepts the "DateTime" data type format. The output of the DateTime will be in a 12-hour format.

Hidden: It helps to identify whether the file is hidden or not. It accepts the "Boolean" data type.

ModifiedTime:  This parameter enables you to retrieve the "Date and Time" when the file was last modified. It accepts the "DateTime" data type format. The output of the DateTime will be in a 12-hour format.

ReadOnly: This parameter helps you determine whether the file is in read-only mode or not. It accepts the Boolean data type.

Size: To view the size of the folder, utilize the variable here which is of "Int64" data type. The output value is displayed as numbers.

SizeOnDisk:  To observe the size on the disk, utilize the variable here which is of "Int64" data type. The output value is displayed as numbers.

TypeOfFile: This parameter helps you identify the type of the provided file. It accepts the "String" data type.

UserPermission: To view the permissions a user has for this specific folder, utilize this variable which is of "DataTable" data type. This can be displayed using a "TableViewer" activity.

 

*Represents mandatory fields to execute the workflow.

Let’s see how this activity works,

1.      Create a new solution or use an existing solution.

2.      Drag and drop a “GetFileInformation” activity to the workflow.

3.      Double-click on the activity and input the path of the file for which we need to
retrieve information.

a.      However, to complete the execution of the activity, we must navigate
to the output box in the property section and enter the variable in the
corresponding section for the required details.

b.     In this case, I intend to obtain the file size details. Thus, I am declaring a variable
within the "Size" box of the output section in the property panel.

4.      Here, I am going to get the details of the size of the file. So, I am declaring a variable
in the Size box of the output box of the property section.

Based on the “datatype” for the output we have chosen, drag and drop the next
activity to see the output.

5.      Drop a writelog activity and enter the variable as “Size.ToString”, to view the output
of the activity. Here we mention “.ToString” in the extension as the Size is in “Int64”
datatype. As we are using the writelog activity which accepts variable only in “String”
datatype, we add this extension.

 

6.      Execute the workflow.


Click here to see how the activity works in a workflow.