#22538 [Csd->Opn]: stream filters & stream_copy_to_stream combo produces bogus output
| From: | moriyoshi@php.net | Date: | Mon, 17 Mar 2003 20:30:09 +0000 |
| Subject: | #22538 [Csd->Opn]: stream filters & stream_copy_to_stream combo produces bogus output | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-35769@lists.php.net to get a copy of this message | ||
ID: 22538
Updated by: moriyoshi@php.net
Reported By: moriyoshi@php.net
-Status: Closed
+Status: Open
Bug Type: Filesystem function related
Operating System: RedHat Linux 8.0 (glibc-2.3.0)
PHP Version: 5CVS-2003-03-04 (dev)
Assigned To: iliaa
New Comment:
The bug still persists.
$ php script2.php < Zend/zend.c
is ok, but it doesn't work with piped stream. Please try the
following:
$ cat script2.php | php script2.php
Previous Comments:
------------------------------------------------------------------------
[2003-03-17 12:33:46] iliaa@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, 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/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2003-03-17 08:26:28] moriyoshi@php.net
Is this a sort of mmap() problem? I have no idea about this problem at
all..
------------------------------------------------------------------------
[2003-03-04 12:56:34] moriyoshi@php.net
Correcting a typo.
wrong: $ php script3.php
right: $ cat Zend/zend.c | php script3.php
------------------------------------------------------------------------
[2003-03-04 12:49:03] moriyoshi@php.net
$ cat Zend/zend.c | php script2.php
produces bogus output, whilst
$ php script1.php
and
$ php script3.php
work correctly.
script1.php:
<?php
$fin = fopen("Zend/zend.c", "r");
$fout = fopen("/tmp/output", "w");
stream_filter_append($fout, "string.rot13");
stream_copy_to_stream($fin, $fout);
fclose($fin);
fclose($fout);
?>
script2.php:
<?php
$fin = fopen("php://stdin", "r");
$fout = fopen("/tmp/output", "w");
stream_filter_append($fout, "string.rot13");
stream_copy_to_stream($fin, $fout);
fclose($fin);
fclose($fout);
?>
script3.php:
<?php
$fin = fopen("php://stdin", "r");
$fout = fopen("/tmp/output", "w");
stream_filter_append($fin, "string.rot13");
stream_copy_to_stream($fin, $fout);
fclose($fin);
fclose($fout);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22538&edit=1