Re: Unbuffered fgetc needed for stdin

From: Date: Sat, 15 Dec 2001 21:34:07 +0000
Subject: Re: Unbuffered fgetc needed for stdin
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-73954@lists.php.net to get a copy of this message
This usually depends on how you configured your tty. I think by default it is buffered by the OS until a newline so it's probably not PHP which needs changing but your settings. Andi At 12:30 PM 12/15/2001 -0800, August Zajonc wrote:
I've really run into a wall trying to get single charachters from stdin. Something similar to the getchar macro or a real fgetc would be nice. The current behavior is that more than a signle charachter can be typed and fgetc only returns when it sees a "\n". I'd like it to return immediatly after the first charachter. fscanf with a format string something like "%c" requires a "\n" before returning as well, though I suppose that is more understandable. various things like fread with length of 1 also don't work. This is missing functionality for which there is no workaround that would certainly make shell scripting easier. It should be relativly trivial to implement, either an unbuffered fgetc option or a new function or something. -AZ -- 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


« previous php.dev (#73954) next »