#22538 [Asn]: stream filters & stream_copy_to_stream combo produces bogus output

From: Date: Mon, 17 Mar 2003 14:26:29 +0000
Subject: #22538 [Asn]: stream filters & stream_copy_to_stream combo produces bogus output
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-35741@lists.php.net to get a copy of this message
 ID:               22538
 Updated by:       moriyoshi@php.net
 Reported By:      moriyoshi@php.net
 Status:           Assigned
 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:

Is this a sort of mmap() problem? I have no idea about this problem at
all..



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

[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



Thread (10 messages)

« previous php.bugs (#35741) next »