Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-21-2004, 08:59 AM   #1
Mike Davies
Registered: Jul 2004
Distribution: Custom Linux 4/Busybox. Fedora 22, Raspberry Pi
Posts: 98

Rep: Reputation: 15
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
Old 03-03-2006, 12:13 AM   #2
Senior Member
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

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

hth --Jonas


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unbuffered Block Device rtg Linux - Hardware 2 09-02-2005 06:50 AM
stdout stdin Furlinastis Linux - Newbie 3 08-11-2005 11:00 PM
Statistics from stdin? edeca Linux - Software 0 05-23-2005 10:03 AM
stdin and NUL. How ? Mike Davies Linux - Software 5 10-28-2004 07:06 AM
unbuffered stdin mvt Programming 7 05-17-2004 09:40 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration