Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!uunet!nwnexus!apex!rennyk From: rennyk@apex.com (Renny K) Newsgroups: comp.lang.c Subject: Re: stdin and the keyboard Message-ID: <1991Jun28.232724.8490@apex.com> Date: 28 Jun 91 23:27:24 GMT References: <1619@opus.NMSU.Edu> Reply-To: rennyk@apex.UUCP (Renny K) Distribution: usa Organization: Apex Computer Co., Redmond WA Lines: 27 In article <1619@opus.NMSU.Edu> mdowell@dante.nmsu.edu (DOWELL) writes: >Hello, > >I've got a quick question... > >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. > >My problem is that when I get input from the command (dir) I set the >file pointer equal to stdin, but when I go to check if a key is >pressed getch() checks stdin and grabs a character from the command. > >I can't get it to recognize the keyboard and the input command >separate instead of both being the stdin. > Okay... Once you show a screenfull of info, reassign the stdin pointer to a file opened to CON:, (make sure you save the old one) and later restore the old one. Renny. -- ------------------------------------------------------------------------------- Renny Koshy rennyk@apex.com Apex Computer, Redmond, WA.