[PHP-DEV] PHP 4.0 Bug #7736 Updated: recode_file generates warning when input fh has received data from remote fh From: zak <email protected>
Date: 11/10/00

ID: 7736
Updated by: zak
Reported By: zak <email protected>
Status: Open
Bug Type: Recode related
Assigned To:
Comments:

I think that problem comes from the fwrite source code
( however my C skills are minimal and I have not carefully dug through the code :)

It seems that when fwrite gets data from a file handle with issock set, it in turn has issock set - thus making recode unhappy...

(This is my blind guess. Hopefully this helps point out the problem (or at least amuses someone :). If I get a chance, I will try to analyze the problem in more detail - however, I short on skill and time for this kind of work.)

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

[2000-11-09 23:18:07] zak <email protected>
recode_file() generates a spurious warning when the 'input' file handle has had data sent to it from a file handle that references a remote system. Despite the warning, the recode attempt succeeds - converting between character sets and writing the data to the 'output' file handle

See the script below.

# Open a local file (instead of URL) and no warning is generated
$input = fopen ('http://www.netscape.com/', 'r');
$tmp = tmpfile ();

while (! feof ($input))
        fwrite ($tmp, fgets ($input, 1024));

rewind ($tmp);

recode_file ('us..flat', $tmp, tmpfile ());

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

Full Bug description available at: http://bugs.php.net/?id=7736

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>