Re: [PATCH] LFS support for PHP 5.5.1
On Fri, 2013-08-30 at 16:43 +0200, X Ryl wrote:
> Hi,
>
>
> Please find attached a patch for adding large file size support to
> PHP 5.5.1.
The patch didn't make it. Please send as text/plain (i.e. using .txt
extension)
> It does so by, from the PHP's side, getting double instead of int for
> the file size/ offset functions, when the size is larger than 2^31.
This has some problems - for further handling onemight need the exact
file size (i.e. content length headers, checking structures, reading
specific positions)
> This means that files with size:
> - up to 2^32 bytes works as previously (integer returned / used)
> - up to 2^52 bytes can be handled correctly (double's mantissa is 52
> bits, no loss in precision here)
This might work for the initial operation, but as soon as the user does
a calculation ("give me the last ten bytes") this will cause issues.
> - from 2^52 up to 2^64 will have their size rounded, yet, reading and
> writing will work as expected since it's done in the PHP's binary.
>
>
> The changes are:
> - Some size_t are changed to off_t wherever required.
This disqualifies from 5.5 and allows use in 5.6 only.
johannes
Thread (3 messages)