Re: Re: PHP Directory List Script Files over 2 GB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

<?php while(list(,$f)=each($files))print
sprintf("_f('%s',%s,'%s','%s',%d);\n",addslashes($f['name']),$f['size'],date($date,$f['date']),addslashes($f['url']),$f['date']);?>

Thank you all for helping

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux