ID:               22538
 Updated by:       [EMAIL PROTECTED]
-Summary:          stream filters & stream_copy_to_stream combo produces
                   bogus output
 Reported By:      [EMAIL PROTECTED]
 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:

And, hmm, here's another script to replicate with.
By this script, It turned out that the issue isn't
stream_copy_to_stream specific.

<?php
function my_stream_copy_to_stream($fin, $fout) {
    while (!feof($fin)) {
        fwrite($fout, fread($fin, 4096));
    }
}
$fin = fopen("Zend/zend.c", "r");
$fout = fopen("/tmp/output", "w");
stream_filter_append($fout, "string.rot13");
my_stream_copy_to_stream($fin, $fout);
fclose($fin);
fclose($fout);
?>

I don't have enough time to fix this right now, so I thank you for
taking your time to look at this one ;-)



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

[2003-03-17 14:34:13] [EMAIL PROTECTED]

Oops, I forgot to try this one...

script 4:

<?php
$fin = popen("cat 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);
?>

This results in the same output.


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

[2003-03-17 14:30:08] [EMAIL PROTECTED]

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


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

[2003-03-17 12:33:46] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

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


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

[2003-03-04 12:56:34] [EMAIL PROTECTED]

Correcting a typo.

wrong: $ php script3.php
right: $ cat Zend/zend.c | php script3.php

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/22538

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

Reply via email to