Re: [PHP] Re: PHP Directory List Script Files over 2 GB
I made a few changes to the script using system calls and changed the datatype to be a string on the sprintf portion of the script I doubt it is the most intelligent method of resolving the issue, but it got the job done. I do not run this on an Internet site, just a local intranet website that I use to monitor backups with so the overhead is minimal. Added the following at the top of the script // SYSTEM CALLS to get information from filesystem/file function GlobSize( $f ) { $fsize = `ls -ltr $f |awk '{print $5}'`; return $fsize; } function GlobDate( $f ) { $fdate = `stat --printf %Y $f`; return $fdate; } Modified code to call the two functions above. stat --printf %y was used to correct the date which was reporting incorrectly as Dec 31 69 on all files larger then 2 GB the ls command to return bytes was used to allow the Javascript to do the correct conversion later in the script. else$files[]=array('name'=>$f,'size'=>GlobSize($path.$f),'date'=>GlobDate($path.$f),'url'=>trim("$root/$dir/".rawurlencode($f),'/')); then modified the the sprintf to be a string for the instead of a d Thank you all for helping -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Directory List Script Files over 2 GB
Well it looks like I am forced to use a different approach do to the limitations of PHP http://bugs.php.net/bug.php?id=27792 This Bug has been around now for HOW long now. Seems to me that it would have been addressed in the past few years, Gigabyte files have been around a long time. Maybe not for the average WEB server but for intranets wanting to display files and sizes well I cant complain too much , this has taught me quite a bit on how to do things using php. The sprintf("%u", filesize($file)) does not appear to resolve this issue either. Thanks to all -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Directory List Script Files over 2 GB
Does anyone else have any other ideas how to resolve this, I have tried multiple different methods all failed. Does the 2 GB limitation using filesize have an alternate method of producing the output. ? Thank you Logan for trying. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Directory List Script Files over 2 GB
Hello everyone My OS information is PHP Version 5.1.6 Apache/2.2.2 (Fedora) Fedora Core 5 Kernel 2.6.20-1.2307.fc5 I am having some trouble with a script that displays files within a directory. the script does not appear to be displaying large files and the date thaty is displayed on these large files is Dec-31-69 I did not create the script I downloaded it from www.celerondude.com/php-indexer I also tried to get some assistance from the authors site but have not been repsonded to yet, so I thought I would try here. The script itself is using php readdir and some javascript functions which is why I am so confused. the main portions of the script is $f,'date'=>filemtime($path.$f),'url'=>'/backupdirs1.php?dir='.rawurlencode(trim("$dir/$f",'/'))); else$files[]=array('name'=>$f,'size'=>filesize($path.$f),'date'=>filemtime($path.$f),'url'=>trim("$root/$dir/".rawurlencode($f),'/')); } closedir($h); $current_dir_name = basename($dir); $up_dir=dirname($dir); $up_url=($up_dir!=''&&$up_dir!='.')?'/backupdirs1.php?dir='.rawurlencode($up_dir):'/backupdirs1.php'; // END PHP ?> Then within the actual HTML I have the following javascript