note 88517 deleted from function.filesize by danbrown
| From: | danbrown@php.net | Date: | Tue, 27 Jan 2009 19:55:53 +0000 |
| Subject: | note 88517 deleted from function.filesize by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149863@lists.php.net to get a copy of this message | ||
Note Submitter: pcs at ngs dot ru
Reason: 5
----
My function GetRealSize(). Limit 8Gb.
<?php
function GetRealSize($file) {
// Return size in Mb
clearstatcache();
$INT = sprintf("%u", 4294967295);//2147483647+2147483647+1;
$size = sprintf("%u",filesize($file));
$fp = fopen($file, 'r');
if (fseek($fp, 0, SEEK_END)!=0) $size = $INT+$size;
fclose($fp);
return ceil($size/1024/1024);
}
?>