Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!sdd.hp.com!wuarchive!udel!rochester!kodak!ispd-newsserver!weimer From: weimer@ssd.kodak.com (Gary Weimer) Newsgroups: comp.lang.c Subject: Re: Redirection question Message-ID: <1990Nov15.153727.3223@ssd.kodak.com> Date: 15 Nov 90 15:37:27 GMT References: <14447@smoke.brl.mil> <1990Nov14.150228.4038@druid.uucp> Sender: news@ssd.kodak.com Organization: Eastman Kodak Lines: 13 In article <1990Nov14.150228.4038@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes: > >How about this for a kludge? Have an input routine that takes a prompt >and a buffer argument and checks to see if there are characters waiting. >If not then issue the prompt. as long as there are characters then you >just read. If there is a human waiting for a prompt then you issue one. >If necessary you can add timing stuff so that slow terminals with stuff >in the pipe don't trigger the prompt. Maybe I'll write this and post it >if I get a little time. This won't work if the program you are piping from runs slower than the program you are piping to (i.e. a spell checker piped through cat). The second program will always be waiting for the first.