#29532 [Opn->Bgs]: bzread reads incorrect quantity of byte
| From: | derick@php.net | Date: | Thu, 05 Aug 2004 10:44:22 +0000 |
| Subject: | #29532 [Opn->Bgs]: bzread reads incorrect quantity of byte | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-64124@lists.php.net to get a copy of this message | ||
ID: 29532
Updated by: derick@php.net
Reported By: bitlz at nezabudka dot ru
-Status: Open
+Status: Bogus
Bug Type: Bzip2 Related
Operating System: windows 2000 server sp 4
PHP Version: 5.0.0
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
http://no2.php.net/bzread
Previous Comments:
------------------------------------------------------------------------
[2004-08-05 12:37:56] bitlz at nezabudka dot ru
Description:
------------
in documentation:
string bzread ( resource bz [, int length])
really:
if used length more than 8192, bzread reads incorrect quantity of byte
( 8192 ).
version php:
PHP 5.0.0 (cli) (built: Jul 13 2004 21:39:58)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0, Copyright (c) 1998-2004 Zend Technologies
Reproduce code:
---------------
qqq.php:
$fpbz = bzopen("1.txt.bz2", "wb");
$fp = fopen("1.txt", "rb");
$a = filesize("1.txt");
echo $a."\n";
$buf = fread($fp,filesize("1.txt"));
$buf = bzwrite($fpbz, $buf);
bzclose($fpbz);
fclose($fp);
$fp = fopen("2.txt", "wb");
$fpbz = bzopen("1.txt.bz2", "rb");
$buf = bzread($fpbz, $a);
fwrite($fp,$buf, $a);
bzclose($fpbz);
fclose($fp);
$a = filesize("2.txt");
echo $a."\n";
Expected result:
----------------
expected result:
D:\@\Work\work\fma\4_1c>php qqq.php
60201
60201
D:\@\Work\work\fma\4_1c>
Actual result:
--------------
actual result:
D:\@\Work\work\fma\4_1c>php qqq.php
60201
8192
D:\@\Work\work\fma\4_1c>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29532&edit=1