ID:               44974
 Updated by:       [EMAIL PROTECTED]
 Reported By:      florian dot ember at gmail dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         Zip Related
 Operating System: Debian
 PHP Version:      5.2.6
-Assigned To:      
+Assigned To:      pajoye


Previous Comments:
------------------------------------------------------------------------

[2008-05-12 18:19:40] florian dot ember at gmail dot com

Description:
------------
Opening archives with more than 1300 or so files fails with ER_READ. I
encountered this while using the close/reopen method to avoid using up
all available filehandles. On a Windows box the script below runs
without errors.

Reproduce code:
---------------
<?php
$za = new ZipArchive;
$za->open('./useless.zip', ZipArchive::CREATE);
for ($i = 1; $i <= 2000; ++$i) {
        $file = "$i.txt";
        touch($file);
        if (!$za->addFile("./$file", $file)) {
                exit("Couldn't add $file");
        }
        echo "Added $file<br />\n";
        if ($za->numFiles % 100 == 0) {
                $za->close();
                $res = $za->open('./useless.zip', ZipArchive::CREATE);
                if ($res !== true) {
                        exit("Close/reopen: Error #$res @ $i");
                }
                echo "Close/reopen @ $i<br />\n";
        }
}
unlink('./useless.zip');
echo 'Done.';

Expected result:
----------------
Added 1.txt
Added 2.txt
[...]
Added 2000.txt
Done.

Actual result:
--------------
Added 1.txt
Added 2.txt
[...]
Added 1299.txt
Close/reopen: Error #5 @ 1300


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44974&edit=1

Reply via email to