reliable reads from pipes
Doug Gwyn
gwyn at smoke.BRL.MIL
Mon Aug 6 21:57:21 AEST 1990
In article <11145 at alice.UUCP> andrew at alice.UUCP (Andrew Hume) writes:
> doug's suggestion to look for \n is doubly important
>because your code has both ends of the pipe open in both processes
>and thus you won't get end of file. the rule is that in the process
>that does the writing should close the reading end of teh pipe
>and vice versa.
In fact, most of us would probably use popen() and let it take care of
the details of getting the pipes set up properly, etc. (Yes, I know
that some popen() implementations have bugs, but I think they all work
well enough for applications like this one.)
More information about the Comp.unix.questions
mailing list