www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/17/22:42:39

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: IO Buffering
Date: Mon, 17 Feb 1997 20:15:34 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 25
Message-ID: <33092CE6.57B9@cs.com>
References: <33086AA3 DOT 51E6 AT xactinc DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp204.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Stephen Lyda wrote:
> 
> Basically, I am trying to cause getchar() to work correctly, returning
> after a single key is pressed, and not waiting until the buffer is
> full or a CR is encountered.

It simply isn't possible.  There is no way to shut off line buffering
for text input streams because of the way DOS works.  If you want to get
a character at a time (or perform other character-style operations), use
the <conio.h> functions, such as getch().  Of course, the conio
functions read directly from the BIOS keyboard handler, so they can't be
redirected like stdin or stdout.

For a complete list of conio functions, install the 'v2gnu/txi390b.zip'
package and type the following words of wisdom:

  info libc func conio

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |        fighteer AT cs DOT com         |
|    *  Proud user of DJGPP!  *    |   http://www.cs.com/fighteer   |
|    ObJoke:  If Bill Gates were a robber, not only would he        |
|     shoot you, but he'd send you a bill for the bullets.          |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019