php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29532 bzread reads incorrect quantity of byte
Submitted: 2004-08-05 12:37 UTC Modified: 2004-08-05 12:44 UTC
From: bitlz at nezabudka dot ru Assigned:
Status: Not a bug Package: Bzip2 Related
PHP Version: 5.0.0 OS: windows 2000 server sp 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bitlz at nezabudka dot ru
New email:
PHP Version: OS:

 

 [2004-08-05 12:37 UTC] 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>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-05 12:44 UTC] derick@php.net
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
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 09 09:03:33 2021 UTC