Your comments
Looks like this is indeed (at least part of) the problem. Someone even created a composer package to solve this issue: https://github.com/jkuchar/BigFileTools/blob/master/src/Driver/NativeSeekDriver.php
If the curl extension is available, looks like that is the fastest way to get the real file size of a file above 2GB on 32-bit systems, with a function like this:
function filesize2($path) {
if (function_exists("curl_init")) {
$ch = curl_init("file://" . $path);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
$data = curl_exec($ch);
curl_close($ch);
if ($data !== false && preg_match('/Content-Length: (\d+)/', $data, $matches)) {
return (float) $matches[1];
}
}
return filesize($path);
}
Maybe you could allow users (admins) to add something in their customizables/config.php, to work around the filesize() issue on their system, if they need to..?
Thanks.
I just noticed that the file size FileRun reports is always exactly equal to filesize modulo 4GB.
The 1.1GB that FileRun reports for this file is actually 1,198,614,939 bytes. And the original file is 9,788,549,531. And 9,788,549,531 minus 8GB (2*4*1024*1024*1024) = 1,198,614,939
So this looks like an overflow issue with PHP on the Raspberry Pi..?
Any known fix?
Customer support service by UserEcho
Thanks.
Might want to indicate 64-bit OS is required, somewhere in https://filerun.com/requirements