Public bug reported: Binary package hint: torrentflux
When using torrentflux to download a file over 4GB the main screen displays the correct size but the 'directory' screen shows a wrong size. It is a known limitation of PHP that filesizes over 2GB are causing strange things. The torrentflux package (version 2.1 seems to be included in Ubuntu 7.04 but I checked the 2.3 package on sourceforge and the same filesize code is still there). The sollution (that i found) is to make the following modifications: in the file functions.php change the function file_size($file) to the following: ====== $size = (float) exec("ls -l ". escapeshellarg( $file ) ." | awk '{print $5}'"); ====== i.e. remove the check whether filesize($file) reports a problem and remove the escaped double quotes for the exec command (as the escapeshellarg($file) will encase the string in single quotes already) (note thet this "escapeshellarg()" is not present in the 2.1 or 2.3 sourceforge package) Also change the dir.php file as follows: Search for "$arStat[7] =" (without the double quotes obviously) Change the following line: ========= $arStat[7] = ( $arStat[7] == 0 )? file_size( $dirName . $entry ) : $arStat[7]; ========= to read as follows: ========= $arStat[7] = file_size( $dirName . $entry ); ========= i.e remove the check whether lstat($file) has reported a problem on the filesize (stored in $arStat[7]) and just use the file_size() function always. I noticed this when trying to download the "ubuntu-7.10-dvd-i386.iso" file from the torrentflux page that torrentflux had grabbed for me (i could only see and download the size that was above 4GB (i.e. about 200MB instead of about 4296MB)) ** Affects: torrentflux (Ubuntu) Importance: Undecided Status: New -- Torrentflux shows wrong filesize for files over 4GB https://bugs.launchpad.net/bugs/155251 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs