|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-10-02 08:05 UTC] exception0x876 at gmail dot com
[2013-12-05 16:59 UTC] mike@php.net
-Package: *General Issues
+Package: Bzip2 Related
[2020-01-05 10:58 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2020-01-05 10:58 UTC] cmb@php.net
[2020-01-19 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 22:00:01 2025 UTC |
Description: ------------ It seems bzread reads only the 1st block of that specific archive. The archive size is: ls -l test.bz2 -rw-r--r-- 1 1000 users 2082194364 Oct 1 07:21 test.bz2 I can extract the archive just fine with system bzip2. Test script: --------------- <?php $filename = 'test.bz2'; $uncompressed = ''; $fp = bzopen($filename, 'r'); if (!$fp) die("Could not open $filename\n"); $size = 0; while (!feof($fp)) { $buf = bzread($fp, 4096); $size+= strlen($buf); if ($buf === false) die("File read problem\n"); $arr = bzerror($fp); if ($arr['errno'] !== 0) die("Compression problem ".$arr['errstr']."\n"); } var_dump($size); bzclose($fp); Expected result: ---------------- int(2082194364) Actual result: -------------- int(900000)