Re: Bug #14537: fgetc fails to return single charachter immediatly
| From: | Markus Fischer | Date: | Sun, 16 Dec 2001 12:29:08 +0000 |
| Subject: | Re: Bug #14537: fgetc fails to return single charachter immediatly | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-73999@lists.php.net to get a copy of this message | ||
You might consider using ncurses_getch() for that purpose.
- Markus
On Sat, Dec 15, 2001 at 08:38:20PM -0000, junk-php@aontic.com wrote :
> From: junk-php@aontic.com
> Operating system: Linux 2.4.7-10smp i686
> PHP version: 4.1.0
> PHP Bug Type: Filesystem function related
> Bug description: fgetc fails to return single charachter immediatly
>
> fgetc should have at least the option of returning a single charachter
> immediatly upon its entry, or another function should be defined (such as
> getchar()) that achieves similar functionality to fgetc(stdin) which return
> a single charachter immediatly.
>
> The following script allows the user to type more than a single charachter
> and only returns when the user hits enter. fgetc should simply block until
> a single charachter is entered and then return.
>
> This is missing functionality that can not be worked around easily as far
> as I can tell.
>
> Script:
>
> $fp = fopen("php://stdin", "r");
> $char = fgetc($fp);
> echo $char;
>
>
> --
> Edit bug report at: http://bugs.php.net/?id=14537&edit=1
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Please always Cc to me when replying to me on the lists.