[PHP-DEV] Bug #8624 Updated: fail to open "php://stderr" From: sas <email protected>
Date: 06/22/01

ID: 8624
Updated by: sas
Reported By: Tomas V.V.Cox <cox <email protected>>
Old-Status: Open
Status: Closed
Bug Type: Filesystem function related
Operating system:
PHP Version: 4.0.4
Assigned To:
Comments:

A fix for this has been committed. The fix will appear in PHP 4.0.7. Thanks for your report.

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

[2001-01-09 20:07:27] Tomas V.V.Cox <cox <email protected>>
The second time I try to open and close the "php://stderr" file descriptor, PHP begins to fail. It doesn't occur with standar files.

You can test the error with the script:
#!/usr/bin/php -q
<?php
function myerror ($error){
        if (!$errfd =  <email protected>("php://stderr", "w+")){
                echo "Can not openn";
                return;
        }
        fwrite ($errfd, $error);
        fclose ($errfd);
        return;
}

for ($i=0; $i<=3; $i++){
        myerror("this is error num: $in");
}
?>

The output:
this is error num: 0
Can not open
Can not open
Can not open

The error:
<b>Warning</b>: fopen("php://stderr","w") - Bad file descriptor in <b>./test.php</b> on line <b>3</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid File-Handle resource in <b>./test.php</b> on line <b>4</b><br>
<br>

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

ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8624&edit=2

-- 
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>