LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   unbuffered stdin (https://www.linuxquestions.org/questions/linux-software-2/unbuffered-stdin-245515/)

Mike Davies 10-21-2004 08:59 AM

unbuffered stdin
 
How can I get unbuffered input on stdin ?

I want to process a character at a time from stdin, but I only seem to get data when an eol or eof character is input. I have tried using getchar(), fgetc(), read(), and also tried modifying the buffering with setvbuf() but with no joy.

The ncurses library seems to have a getch() routine, but the program just output reams of nonsense when I link to that library.

Can anyone help. I'm sure there must be an easy answer.

Never had this problem with Win95/Win98

jonaskoelker 03-03-2006 12:13 AM

It sounds like what you want is the cbreak(3NCURSES) mode of curses (and possibly noecho as well).

hth --Jonas


All times are GMT -5. The time now is 03:20 AM.