|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2003-08-16 02:48 UTC] batjohan at home dot se
 Description: ------------ $handle = fopen ($file, "r"); $handle2 = bzopen($file2, "a"); fseek($handle,$vart); $buffer = fread($handle, 8192); if(!bzwrite($handle2, $buffer, strlen($buffer))) // <-- here it stops.. dont write something out... create a new file not more... Reproduce code: --------------- http://www2.park.se/~te04-54/bug.html Expected result: ---------------- To compress the file... but it hangs... when i use zlib it compress the file.. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 03:00:01 2025 UTC | 
Using this script: <?php $file = '/etc/group'; // just some file.. :) $file2 = './foo.bz2'; $handle = fopen ($file, "r"); $handle2 = bzopen($file2, "a"); // 'w' works fine $buffer = fread($handle, 8192); if(!bzwrite($handle2, $buffer, strlen($buffer))) { echo "Foo\n"; } ?> The first run (when foo.bz2 does not exist) produces this error: Warning: bzwrite(): supplied argument is not a valid stream resource in /home/jani/t.php on line 8 Second run (foo.bz2 exists) -> Hangs.