note 77014 added to function.filesize
| From: | Radon8472 at osu1 dot php dot net | Date: | Fri, 10 Aug 2007 11:03:26 +0000 |
| Subject: | note 77014 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129394@lists.php.net to get a copy of this message | ||
the fastest way to get the correct filesize in windows an linux would be this:
<?php
echo sprintf("%u", filesize($file));
?>
It prints the result of filesize as UNSIGNED INT so it can be until 4GB.
The reason is, SIGNED INT runs until 2GB and flips to -2GB watch following:
file<2GB = SIGNED: 1048576512 UNSIGNED: 1048576512
file>2GB = SIGNED: -2100140103 UNSIGNED: 2194827193
file>4GB = SIGNED: -100662784 UNSIGNED: 4194304512
p.s. I found this at: http://www.php.net/manual/en/function.filesize.php
----
Server IP: 69.147.83.197
Probable Submitter: 84.179.65.9
----
Manual Page -- http://www.php.net/manual/en/function.filesize.php
Edit -- https://master.php.net/note/edit/77014
Del: integrated -- https://master.php.net/note/delete/77014/integrated
Del: useless -- https://master.php.net/note/delete/77014/useless
Del: bad code -- https://master.php.net/note/delete/77014/bad+code
Del: spam -- https://master.php.net/note/delete/77014/spam
Del: non-english -- https://master.php.net/note/delete/77014/non-english
Del: in docs -- https://master.php.net/note/delete/77014/in+docs
Del: other reasons-- https://master.php.net/note/delete/77014
Reject -- https://master.php.net/note/reject/77014
Search -- https://master.php.net/manage/user-notes.php