How do I get EOF from a pipe I created?

Tim Cook timcc at csv.viccol.edu.au
Thu Aug 9 02:23:53 AEST 1990


In article <6366.26be9bd9 at csv.viccol.edu.au>, I asked for help with pipes.

Well, it seems I did overlook something that should have been obvious. 
Both processes needed to close the write end of the pipe before the read
end would see EOF.  My other problem where my ``child'' process got control
of the tty was due to a switch statement that I wrote but did not
double-check (I did not actually use an if statement like the one in my
example code).  I got the parent confused with the child.

Thanks to those who wrote with answers, and to those who are yet to write
(due to the propagation properties of Usenet and the wizards mailing list).

One last thing.  Only one person has written so far and suggested popen(3),
which would have done what I was wanting to do nicely.  I didn't think of
it because I don't get mention of it when I do a "man -k pipe" on my
system.
--
Tim Cook     Systems Administrator, Victoria College Computer Services

parrot - n.  An animal that has the ability to imitate man, but not the
             intelligence to refrain from doing so.



More information about the Comp.unix.wizards mailing list