Bug #52486 [Opn->Csd]: wrong uncompressed size in append mode

From: Date: Mon, 23 Aug 2010 15:52:26 +0000
Subject: Bug #52486 [Opn->Csd]: wrong uncompressed size in append mode
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153720@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52486&edit=1 ID: 52486 User updated by: denis at bitrix dot ru Reported by: denis at bitrix dot ru Summary: wrong uncompressed size in append mode -Status: Open +Status: Closed Type: Bug Package: Zlib Related Operating System: linux PHP Version: 5.2.14 Block user comment: N New Comment: I was wrong. This is normal behavior. Previous Comments: ------------------------------------------------------------------------ [2010-07-29 13:08:06] denis at bitrix dot ru Description: ------------ The last 4 bytes in GZIP file must contain the size of uncompressed data. When you write in append mode, php writes just the size of the last chunk. Test script: --------------- <? $str = '0123456789'; // 10 bytes $f = gzopen('tmp.gz','w'); gzwrite($f, $str); gzclose($f); $f = gzopen('tmp.gz','a'); gzwrite($f, $str); gzclose($f); ?> # gzip -l tmp.gz Expected result: ---------------- uncompressed 20 Actual result: -------------- uncompressed 10 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52486&edit=1

« previous php.bugs (#153720) next »