ID:               38086
 Updated by:       [EMAIL PROTECTED]
 Reported By:      webrika at mail dot ru
-Status:           Open
+Status:           Closed
 Bug Type:         Streams related
 Operating System: FreeBSD 6.1
 PHP Version:      5.1.4
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2006-07-13 02:50:24] webrika at mail dot ru

Description:
------------
stream_copy_to_stream() returns 0 when maxlength is bigger then the
actual length. But copying is ok.

Reproduce code:
---------------
$src = fopen('http://www.php.net', 'r');
$dest = fopen('ok.txt', 'w');
echo stream_copy_to_stream($src, $dest) . " bytes copied\n";
fclose($src); fclose($dest);

$src = fopen('http://www.php.net', 'r');
$dest = fopen('BUG.txt', 'w');
echo stream_copy_to_stream($src, $dest, 100000) . " bytes copied\n"; //
returns zero
fclose($src); fclose($dest);

echo filesize('ok.txt')."\n";
echo filesize('BUG.txt')."\n";


Expected result:
----------------
39821 bytes copied
39821 bytes copied
39821
39821

Actual result:
--------------
39821 bytes copied
0 bytes copied
39821
39821


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38086&edit=1

Reply via email to