ID: 48596 Updated by: pierr...@php.net Reported By: php_nospam at ramihyn dot sytes dot net -Status: Open +Status: Bogus Bug Type: Streams related Operating System: * PHP Version: 5.*, 6CVS (2009-07-17) New Comment:
In the reproduce code, the file pointer is open for write only. I tested the same code with the file pointer open for read/write and it worked as expected on 5.2.11 and 5.3.1 Previous Comments: ------------------------------------------------------------------------ [2009-07-16 18:21:30] php_nospam at ramihyn dot sytes dot net The scripts show the same behaviour in PHP 5.2.6 ------------------------------------------------------------------------ [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] j...@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. ------------------------------------------------------------------------ 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