From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200608312045.k7VKjsw01324@demeter.cs.utwente.nl> To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] trying to understand how fork/pipe a filtering program In-reply-to: Your message of "Thu, 31 Aug 2006 21:24:58 +0100." <43797a19394ce8f10a30710c76d1d46b@vitanuova.com> References: <43797a19394ce8f10a30710c76d1d46b@vitanuova.com> From: Axel Belinfante MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1318.1157057153.1@demeter.cs.utwente.nl.cs.utwente.nl> Date: Thu, 31 Aug 2006 22:45:54 +0200 Topicbox-Message-UUID: aca46b96-ead1-11e9-9d60-3106f5b1d025 > oops skim reading again! > i'd thought i'd read "using two pipes unidirectionally *doesn't* make it work." > so why can't you just use two pipes unidirectionally? you can't do anything > else in this example, because by using the same pipe for input and output, > the command itself keeps its own input open, and therefore never receives EOF. seems it took me a while to realize that. the funny thing is that, somehow, using the same pipe for input and output does work (at least for me) if in the parent I have an fprint or a sleep between the writing+closing part and the reading part, as in the message with which I started this thread. that said, I'm much happier with the 'two unidirectional pipes' solution. Axel.