#22538 [Opn]: stream filters & stream_copy_to_stream combo produces bogus output
| From: | moriyoshi@php.net | Date: | Tue, 04 Mar 2003 18:56:34 +0000 |
| Subject: | #22538 [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-34798@lists.php.net to get a copy of this message | ||
ID: 22538
Updated by: moriyoshi@php.net
Reported By: moriyoshi@php.net
Status: Open
Bug Type: Filesystem function related
Operating System: RedHat Linux 8.0 (glibc-2.3.0)
PHP Version: 5CVS-2003-03-04 (dev)
New Comment:
Correcting a typo.
wrong: $ php script3.php
right: $ cat Zend/zend.c | php script3.php
Previous Comments:
------------------------------------------------------------------------
[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