Re: Half-closing bidirectional pipes
Re: Half-closing bidirectional pipes
- Subject: Re: Half-closing bidirectional pipes
- From: Dave Zarzycki <email@hidden>
- Date: Tue, 29 May 2007 12:55:28 -0700
Pipes, are by definition, uni-directional. You should not rely on any
implementation (Mac OS X or otherwise) that uses bi-directional pipes.
In fact, pipes in the next version of Mac OS X are uni-directional.
If you want bi-directional behavior, please use a local domain socket
(also known as Unix domain socket). Then you can use the shutdown()
API to close one direction of the socket.
davez
On May 29, 2007, at 12:45 PM, Tomasz Kukielka wrote:
Hello,
It is not very clear to me but it looks like pipes in Mac OS 10.4 are
bidirectional. If yes, how can I half-close such pipe, sending EOF
when I
finish writing but keep it open for reading?
What am I trying to do? popen(cmd, "r+") of course. So I want to
send some
data to standard input of an executed tool, close the writing part
and read
the result. I cannot just close everything when I finish writing
because
then I will not get the result in standard output. And if I don't
send the
EOF when writing, some tools will not start processing it (e.g. grep).
TIA,
Tom
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden