186
Views
2
Comments
Solved
Get file size larger than 32 bit Integer (2,147,483,647 bytes)
Question

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


FileSizeOverflow.jpg
2019-06-15 21-39-22
Afonso Carvalho
 
MVP
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:

2018-09-27 18-20-33
Swatantra Kumar
Champion

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.

2019-06-15 21-39-22
Afonso Carvalho
 
MVP
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:

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.