Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cunixf.cc.columbia.edu!sol.ctr.columbia.edu!samsung!usc!rpi!ghost.unimi.it!hplda1.unipv.it!ipvvis!rubini From: rubini@ipvvis.unipv.it (Alessandro Rubini) Newsgroups: comp.lang.c Subject: Re: stdin and the keyboard Message-ID: Date: 27 Jun 91 16:47:44 GMT References: <1619@opus.NMSU.Edu> Sender: usenet@hplda1.unipv.it (Usenet News Administration) Distribution: usa Organization: Universita' di Pavia - Italy Lines: 24 Nntp-Posting-Host: ipvvis Mike Dowell (mdowell@dante.nmsu.edu) writes: > I am trying to write a replacement for the DOS more command. I would > like it to function as closely like the original as possible, > therefore piping of commands is needed, ie dir | more. > I can't get it to recognize the keyboard and the input command > separate instead of both being the stdin. > I am running Borland C++ on a PC if that helps any. I use MSC, but I think It's the same. Getch _does_ read stdin, though the library reference claims it reads the keyboard. You should read the keyboard through int86(16H,...), usable also to flush the input buffer. Of course, you're killing portability... If you're not familiar with INTs I can give you a little inkey(), allowing you to filter the input, too. I wrote it to implement F1-HELP. Ru. -- Alessandro Rubini Almo Collegio Borromeo Piazza Borromeo 9