note 106296 deleted from function.filesize by aharvey
| From: | aharvey@php.net | Date: | Tue, 22 Jan 2013 00:19:09 +0000 |
| Subject: | note 106296 deleted from function.filesize by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193320@lists.php.net to get a copy of this message | ||
Note Submitter: Dojung Kim
----
It could be useful for over 2GB files in linux system.
Using awk, I could find real size of its file.
<?php
function filesize_n($path)
{
$size = @filesize($path);
if( $size < 0 ){
ob_start();
system('ls -al "'.$path.'" | awk \'BEGIN {FS=" "}{print
$5}\'');
$size = ob_get_clean();
}
return $size;
}
?>