Bug #7960 Updated: fopen or fclose troubles with 'php://stdin'
| From: | sander@php.net | Date: | Fri, 19 Oct 2001 12:01:35 +0000 |
| Subject: | Bug #7960 Updated: fopen or fclose troubles with 'php://stdin' | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-68361@lists.php.net to get a copy of this message | ||
ID: 7960
Updated by: sander
Reported By: p.pastori@acsys.it
Old Status: Open
Status: Closed
Bug Type: Filesystem function related
Operating System: WIN32, WINNT, IRIX
PHP Version: 4.0.3pl1
New Comment:
Works fine for me on Win2K, using 4.0.7RC3. You should upgrade to a newer version. Reopen if the
problem still exists.
Previous Comments:
------------------------------------------------------------------------
[2000-11-24 04:57:04] p.pastori@acsys.it
<?php
/* fopen bug ??? */
function ask($prompt = '', $mxin = 256) {
$ret = false;
print($prompt);
$ifd = fopen('php://stdin', 'r');
if ($ifd) {
$ret = fgets($ifd, $mxin);
if (! fclose($ifd)) print("FCLOSE FAILED\r\n");
}
return $ret;
}
if ($rep = ask()) print($rep);
/*
* next ask call causes under WIN32 WIN98 Second Edition:
*[23-Nov-2000 22:51:02] PHP Warning: fopen("php://stdin","r") - No error in
fopenbug.php on line 6
* under IRIX 6.5 (6.5.8m):
*[24-Nov-2000 10:35:21] PHP Warning: fopen("php://stdin","r") - Bad file
number in fopenbug.php on line 6
* and under WINNT 4.0 Service Pack 6:
*[24-Nov-2000 10:49:34] PHP Warning: fopen("php://stdin","r") - No error in
fopenbug.php on line 6
*/
if ($rep = ask()) print($rep);
?>
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=7960&edit=1