A fix for limited 32 bits supports
| From: | X Ryl | Date: | Fri, 11 Sep 2009 15:38:35 +0000 |
| Subject: | A fix for limited 32 bits supports | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-45563@lists.php.net to get a copy of this message | ||
Hi,
I was a bit disappointed to see that filesize, stat et al don't work on
32bits systems, because they are using 32 bits integer.
I've found a patch written by Wes, but unfortunately it didn't worked.
Well, now, I've found this:
http://bugs.php.net/bug.php?id=48886
This is done right, it works for all streams, not just file.
I think it just the best solution now without breaking the ABI with modules.
With this patch you get 52 bits filesize (which is more than enough with a
32 bits system), 52 bits offset, and so on.
With unmodified PHP code, it's working because the type is used as a double
when it overcome the 32 bit limit.
So instead of this ugly fix : "sprintf("%u", $value)" for 2GB up to 4GB, you
have this one "sprintf("%.0f", $value)", which works with file size < 4503TB
on 32 bits machines.
Please advise.