Bug #14003 Updated: fgetc from php://stdin doesn't return after one byte typed
| From: | iliaa@php.net | Date: | Wed, 24 Jul 2002 20:57:14 +0000 |
| Subject: | Bug #14003 Updated: fgetc from php://stdin doesn't return after one byte typed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-15078@lists.php.net to get a copy of this message | ||
ID: 14003
Updated by: iliaa@php.net
-Reported By: llam@alumni.uwaterloo.ca
+Reported By: ilia@prohost.org
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
-Operating System: Windows 2000
+Operating System: Linux 2.4.17
PHP Version: 4.0.6
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This is a normal behavour, if you try simular code in C you will get
the same results.
Consider using ncurses.
Previous Comments:
------------------------------------------------------------------------
[2001-11-09 20:09:42] llam@alumni.uwaterloo.ca
<?
$rtdin = fopen("php://stdin", "r");
for(;;){
$c = fgetc($rtdin);
fflush($rtdin);
if ($c == 'q') break;
else echo "you pressed:" . $c . "\n";
}
?>
=========
This script doesn't work as expected: fgetc doesn't return until "\n"
is read from stdin.
How can I catch single key-presses from the keyboard?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=14003&edit=1