#48309 [Opn->Csd]: stream_copy_to_stream() and fpasstru() do not update stream position

From: Date: Sun, 17 May 2009 14:59:48 +0000
Subject: #48309 [Opn->Csd]: stream_copy_to_stream() and fpasstru() do not update stream position
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-137415@lists.php.net to get a copy of this message
 ID:          48309
 Updated by:  lbarnaud@php.net
 Reported By: lbarnaud@php.net
-Status:      Open
+Status:      Closed
 Bug Type:    Streams related
 PHP Version: 5
 Assigned To: lbarnaud
 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:
------------------------------------------------------------------------

[2009-05-17 14:48:40] lbarnaud@php.net

Description:
------------
stream_copy_to_stream() and fpasstru() do not update stream position of
source stream, when source stream is a plain file.



Reproduce code:
---------------
<?php

$fd = tmpfile();
fwrite($fd, b"test");
fseek($fd, 0, SEEK_SET);

stream_copy_to_stream($fd, STDOUT, 2);

echo "\n";
var_dump(stream_get_contents($fd));

?>

Expected result:
----------------
te
string(2) "st"

Actual result:
--------------
te
string(4) "test"


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


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



Thread (2 messages)

« previous php.bugs (#137415) next »