FileLength (String filePath)
Name | FileLength |
Syntax | FileLength (String filePath) |
Purpose | To return length of the specified file. |
Description | Returns the number of bytes in a specified file. |
Return Type | Int64 |
Parameter | filePath [System.String] – Path of the source file |
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fastera-software%2FAstera_Data_Stack_v9%2Fblob%2Fmain%2F.gitbook%2Fassets%2F0%2520%28189%29.png&width=768&dpr=4&quality=100&sign=4f3842aa&sv=1)
Example
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
filePath = C:\Users\Kanwal.Azim\OneDrive - Astera Software\Desktop\Functions Documentation\Files\FileLength\Test.txt
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fastera-software%2FAstera_Data_Stack_v9%2Fblob%2Fmain%2F.gitbook%2Fassets%2F1%2520%28189%29.png&width=768&dpr=4&quality=100&sign=85278957&sv=1)
Right-click on the function transformation object and select Preview Output. You can see that Astera Data Stack has returned the number of bytes in the specified file, as evident below:
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fastera-software%2FAstera_Data_Stack_v9%2Fblob%2Fmain%2F.gitbook%2Fassets%2F2%2520%28189%29.png&width=768&dpr=4&quality=100&sign=75e721d0&sv=1)