Get file size larger than 32 bit Integer (2,147,483,647 bytes)

I'm working on a web application where I'm scanning a list of files in a directory using Filesystem v303.

The problem is all of the actions and structures indicate the file size as an integer, when I need a long integer, as the files are often larger than 2.1 GB. If the file is larger than that, the size will overflow into a negative value.

Does anyone have any ideas?

I am using OutSystems 11.5.43 Build 1969

Ryan,


Do you need to know the size of the files or the file contents?


File_GetSize returns the size of the file in bytes. And yes this is an Integer value, meaning it will go wrong with files > 2GiB. A Long Integer could help here.

If the content is required, you can simply use File_ReadBinary, it returns the binary content.

Solution

Hi Ryan,

This looks like it will require changes in the FileSystem extension to support larger results. You can open up the extension and try to see how the File_GetSize method is implemented to figure out any needed changes for Long Integer or you could contact the component Team to see if they would be willing to support it:

Solution