|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-05 12:44 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 02:00:01 2025 UTC |
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>