LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 10-21-2004, 08:59 AM   #1
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux 3.1/Busybox. Fedora 19, Raspberry Pi
Posts: 94

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
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

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

hth --Jonas
 
  


Reply


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


All times are GMT -5. The time now is 12:27 AM.

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