🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #4114

Re: How can I unbuffer stdin?

#4114
From: Glenn L. Williams
Date: Thu, 03 Jan 1991 22:04
29 lines
1826 bytes
In article <3169@gmuvax2.gmu.edu>, mhovan@gmuvax2.gmu.edu (Mike Hovan) writes...
>I am attempting to read a character at a time from stdin using getch.
>Unfortunately, it buffers my input until enter is pressed.  I tried
>unbuffering stdin using something like:
> 
>		setvbuf(stdin,NULL,_IONBF,0);
> 
>but it doesn't seem to help.  I don't want to use the conio functions
>because the input is going to be redirected using ctty.  Does anybody
>have a fix?  Does anybody know what I am talking about?  Does anybody
>care?  Does anybody really know what time it is?
> 
>		Mike
> 
>-- 
>  |X|X|"Pay no mind to what they say,           Michael Andrew Hovan III |X|X|
>  |X|   Doesn't matter anyway hey hey hey,      mhovan@gmuvax2.gmu.edu     |X|
>  |X|   Our lips are sealed."                   George Mason University    |X|
>  |X|X|                       --The Go-Go's     Fairfax, Virginia, USA   |X|X|

I use DOS interrupts and go directly read the keyboard. There is at least one
funny situation like that.  I found that when you start a program with
standard input redirected:

   dothis <withme

you can't get back to the keyboard after the contents of <withme have
been sucked in.  However, the DOS interrupt method can then be used
to look at the keyboard.
Technical Details
Message-ID: <1991Jan3.220443.17347@eagle.lerc.nasa.gov>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!eagle!news
References: <3169@gmuvax2.gmu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!eagle!news
From: edwill@earth.lerc.nasa.gov (Glenn L. Williams)
Newsgroups: comp.os.msdos.programmer
Subject: Re: How can I unbuffer stdin?
Keywords: stdin buffered unbuffer
Message-ID: <1991Jan3.220443.17347@eagle.lerc.nasa.gov>
Date: 3 Jan 91 22:04:43 GMT
References: <3169@gmuvax2.gmu.edu>
Reply-To: edwill@earth.lerc.nasa.gov
Organization: NASA Lewis Research Center
Lines: 29
News-Software: VAX/VMS VNEWS 1.3-4