Redirection question

Gary Weimer weimer at ssd.kodak.com
Fri Nov 16 02:37:27 AEST 1990


In article <1990Nov14.150228.4038 at druid.uucp> darcy at 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.



More information about the Comp.lang.c mailing list