Path: 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 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