[PATCH] Fix for 32 bits limit on file size (see bug 48886)

From: Date: Tue, 22 Dec 2009 15:10:15 +0000
Subject: [PATCH] Fix for 32 bits limit on file size (see bug 48886)
Groups: php.internals 
Request: Send a blank email to internals+get-46490@lists.php.net to get a copy of this message
Hi, I'm not a C developer, so I can't really help with the attached patch. However, I've tried it with PHP 5.3.0 version I have and it does what it claims, that is, it gives correct behaviour for the following functions: filesize, fstat, stat when used on file > 4GB on a 32 bits machine. Currently, php 5.x doesn't give the correct output for this code (on my 32bits server): echo filesize("path/to/4.3GBfile"); // expecting 4617089843, got 322122547 With the patch applied, the good result is returned. From the patch author, it improves the tests results. From what I've understood, the patch switch to php's double type when the size overflow the 32bits limit of int. It doesn't seem to break any existing behaviour (I'm using this on my multiple project since july, and no bad experience so far). The explaination by the patch author: http://bugs.php.net/bug.php?id=48886

« previous php.internals (#46490) next »