#48596 [Com]: stream_filter_remove() example code does not work
| From: | php_nospam at ramihyn dot sytes dot net | Date: | Thu, 16 Jul 2009 18:21:31 +0000 |
| Subject: | #48596 [Com]: stream_filter_remove() example code does not work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-139828@lists.php.net to get a copy of this message | ||
ID: 48596
Comment by: php_nospam at ramihyn dot sytes dot net
Reported By: php_nospam at ramihyn dot sytes dot net
Status: Feedback
Bug Type: Streams related
Operating System: *
PHP Version: 5.3.0RC3
Assigned To: fb-req-jani
New Comment:
The scripts show the same behaviour in PHP 5.2.6
Previous Comments:
------------------------------------------------------------------------
[2009-07-15 02:38:50] php_nospam at ramihyn dot sytes dot net
Yes, for all pieces of code specified in this bug report, and PHP
version 5.2.10; i do not have PHP 5.2.9 anymore, the download server
too, so i can't tell about 5.2.9
------------------------------------------------------------------------
[2009-07-09 20:25:11] jani@php.net
Does this happen with PHP 5.2.10 and 5.2.9 ?
------------------------------------------------------------------------
[2009-06-23 19:53:11] php_nospam at ramihyn dot sytes dot net
Had to recompile PHP because i didn't have zlib and bzip2 included, but
now i've also tested the other pieces of code on the Linux VM.
Same result as on the Windows box.
Using filters seems to corrupt the file handle somehow:
After using a compression filter to write to a file, ftell() returns
the same value as before appending the filter, but it is still possible
to write to the file.
After using a decompression filter to read from a file, ftell() returns
the same value as before appending the filter, but every call to fread()
returns an empty string.
In addition, if the script first reads something from the stream, then
a decompression filter is appended for reading and the script tries to
read something, i get the following warning:
Warning: stream_filter_append(): Filter failed to process pre-buffered
data in .../test.php on line 11
Is it, somehow, possible to have the buffers flushed in that case?
------------------------------------------------------------------------
[2009-06-23 18:10:24] php_nospam at ramihyn dot sytes dot net
The example code for stream_filter_remove() doesn't run on my Linux VM
either, which i compiled 5.3.0RC4 on. Same result as on my Windows box:
it correctly writes to the "test.txt" file what it should, but
fpassthru() doesnt output anything.
Doesn't seem to be windows specific.
------------------------------------------------------------------------
[2009-06-23 11:25:57] pajoye@php.net
Is it windows specific?
------------------------------------------------------------------------
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/48596
--
Edit this bug report at http://bugs.php.net/?id=48596&edit=1