ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FileLen with very large files (https://www.excelbanter.com/excel-programming/344908-filelen-very-large-files.html)

simonc

FileLen with very large files
 
I need to determine the size of an input file to work out how many times to
run through a loop. One of my input files is 2,878,231,056 bytes long, and
when I run FileLen it returns the value -1416736240 because FileLen returns a
Long integer, and the range of Lond integers is only -2,147,483,648 to
2,147,483,647

Can anyone suggest how to determine file lengths for files which are bigger
than 2,147,483,647 bytes? ( I might need to examine files which are bigger
than 5 GB, so it will not always work to take the twos complement of the
returned file size.)

Grateful for any suggestions.

exceluserforeman

FileLen with very large files
 
Look up filesystemobject in VBeditor Help




"simonc" wrote:

I need to determine the size of an input file to work out how many times to
run through a loop. One of my input files is 2,878,231,056 bytes long, and
when I run FileLen it returns the value -1416736240 because FileLen returns a
Long integer, and the range of Lond integers is only -2,147,483,648 to
2,147,483,647

Can anyone suggest how to determine file lengths for files which are bigger
than 2,147,483,647 bytes? ( I might need to examine files which are bigger
than 5 GB, so it will not always work to take the twos complement of the
returned file size.)

Grateful for any suggestions.



All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com