Req #34750 [Opn]: filesize()/stat() fails on too big files
| From: | aulbach at mayflower dot de | Date: | Mon, 12 Mar 2012 14:25:02 +0000 |
| Subject: | Req #34750 [Opn]: filesize()/stat() fails on too big files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168373@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=34750&edit=1
ID: 34750
User updated by: aulbach at mayflower dot de
Reported by: aulbach at mayflower dot de
Summary: filesize()/stat() fails on too big files
Status: Open
Type: Feature/Change Request
Package: *General Issues
Operating System: *
PHP Version: 5CVS,6CVS,4CVS (2008-02-22)
Block user comment: N
Private report: N
New Comment:
Off-Topic @ sam_account3 at hotmail dot co dot uk:
How could the operating-system be important in this bug? Either PHP can handle the filesize or not.
Otherwise the bug isn't fixed, because at OS1 the bug appears then after 32 Petabytes but at
OS2 the bug appears only Tuesdays.
It's no matter how it's done/how the size is stored, but when it is fixed, there should be
no limits such as the operating system.
For example: To go arround the limits of this bug I stored the filesize as a string, like a database
does. So PHP handles the filesize not as INT but as STRING. This is a kind of fix, which will work
anymore in 30 years. Perhaps some of you have smarter ideas... :)
Previous Comments:
------------------------------------------------------------------------
[2012-03-11 12:16:38] sam_account3 at hotmail dot co dot uk
Please avoid writing '*' in the OS field. This is particularly important here, as your
request is platform-dependant. PHP uses 4 bytes to store an integer on 32-bit systems, and 8 bytes
on 64-bit systems.
------------------------------------------------------------------------
[2010-08-24 10:54:00] aulbach at mayflower dot de
Nice. Perhaps I mix something up, but don't forget to fix stat() too. :)
------------------------------------------------------------------------
[2010-08-23 22:11:59] dominic dot benson at thirdlight dot com
The patch takes advantage of floats being doubles in PHP (with 53 bits of precision under linux 32)
- in the patch LLONG_MAX is hardcoded as its actual value, this should really be derived from
limits.h. It depends on PHP being built with the largefile compile flags to actually work (it fixes
the integer wrapping that then occurs). It should be harmless on 64 bit, but ideally configure would
check long vs. double on the system and include the additional section or not based on that.
------------------------------------------------------------------------
[2005-10-06 10:38:36] aulbach at mayflower dot de
- it's not a feature request, it's a workarround over a problem, that otherwise cannot be
solved within PHP! (without calling external programs)
- For longer term, there is no question, that PHP needs 64 bit integer.
------------------------------------------------------------------------
[2005-10-06 10:22:20] derick@php.net
This is not a bug, but a feature request.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=34750
--
Edit this bug report at https://bugs.php.net/bug.php?id=34750&edit=1