delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/01/09:02:12

Date: Wed, 1 Apr 1998 17:00:12 +0300 (IDT)
From: Eli Zaretskii <eliz AT elta DOT co DOT il>
To: Nate Eldredge <eldredge AT ap DOT net>
cc: viking AT flying-brick DOT caverock DOT net DOT nz,
djgpp Mailing list <djgpp AT delorie DOT com>
Subject: Re: Pipes and how to seek
In-Reply-To: <199804010554.VAA22721@adit.ap.net>
Message-ID: <Pine.SUN.3.91.980401165724.7170C-100000@is>
MIME-Version: 1.0

On Tue, 31 Mar 1998, Nate Eldredge wrote:

> Your program will have to put stdin in binary mode as well. The recommended
> method is:
> 
> if (isatty(fileno(stdin))
>    setmode(fileno(stdin), O_BINARY);

Should be "!isatty", right?

> while `kbhit' and `getch' talk directly to the BIOS.

That's a common misconception.  `getch' calls DOS character input 
function, so it can be redirected (try it).  (`kbhit' indeed calls BIOS, 
so it cannot be used with redirected stdin.)

- Raw text -


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