note 54853 added to function.stat
| From: | mpb dot mail at gmail dot com | Date: | Sun, 17 Jul 2005 22:10:44 +0000 |
| Subject: | note 54853 added to function.stat | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92089@lists.php.net to get a copy of this message | ||
If you are working with files larger than 2GB (and PHP's integer type is only 32 bits on your
system) then you can try the following to get floating point sizes:
On FreeBSD:
$size = (float) exec ('stat -f %z '. escapeshellarg ($path));
On Linux:
$size = (float) exec ('stat -c %s '. escapeshellarg ($path));
(The other example that uses "ls" and "awk" does not properly escape the
filename, but should work otherwise.)
----
Manual Page -- http://www.php.net/manual/en/function.stat.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54853
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54853&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54853&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54853&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54853&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54853&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54853&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54853&report=yes
Search -- http://master.php.net/manage/user-notes.php