Boost logo

Boost Users :

Subject: Re: [Boost-users] named pipes in boost for Linux
From: Boris Schaeling (boris_at_[hidden])
Date: 2010-12-18 11:05:54


On Sat, 18 Dec 2010 11:52:19 +0100, rohini chandra pallapothu
<rohinichandrap_at_[hidden]> wrote:

> [...]I have seen this documentation before. It says that two processes
> have to be
> related.

Rohini,

you can download the latest draft of Boost.Process from
http://www.highscore.de/boost/gsoc2010/process.zip. This version provides
stream behaviors to configure streams of a child process. Among others a
stream behavior for named pipes is provided. You could use it like this:

named_pipe np("/tmp/mypipe");
stream_ends ends = np(input_stream);
... = ends.child.native();
... = ends.parent.native();

The parameter passed to named_pipe::operator()() tells the stream behavior
if the child handle should be configured for input or output. stream_ends
is basically a std:pair<handle, handle> without requiring developers to
remember what the child and the parent handle is. And the method
handle::native() (and handle::release()) can be used to get the file
descriptor on Unix and the HANDLE on Windows.

HTH,
Boris

> [...]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net