note 68814 added to function.filemtime
| From: | csnyder at chxo dot com | Date: | Fri, 11 Aug 2006 15:59:57 +0000 |
| Subject: | note 68814 added to function.filemtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115803@lists.php.net to get a copy of this message | ||
If PHP's integer type is only 32 bits on your system, filemtime() will fail on files over 2GB
with the warning "stat failed". All stat()-related commands will exhibit the same
behavior.
As a workaround, you can call the system's stat command to get the modification time of a file:
On FreeBSD:
$mtime = exec ('stat -f %m '. escapeshellarg ($path));
On Linux:
$mtime = exec ('stat -c %Y '. escapeshellarg ($path));
Thanks to "mpb dot mail at gmail dot com" for his/her similar comment on stat().
----
Server IP: 216.194.113.175
Probable Submitter: 209.11.29.178
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.filemtime.php
Edit -- https://master.php.net/note/edit/68814
Del: integrated -- https://master.php.net/note/delete/68814/integrated
Del: useless -- https://master.php.net/note/delete/68814/useless
Del: bad code -- https://master.php.net/note/delete/68814/bad+code
Del: spam -- https://master.php.net/note/delete/68814/spam
Del: non-english -- https://master.php.net/note/delete/68814/non-english
Del: in docs -- https://master.php.net/note/delete/68814/in+docs
Del: other reasons-- https://master.php.net/note/delete/68814
Reject -- https://master.php.net/note/reject/68814
Search -- https://master.php.net/manage/user-notes.php