<div dir="ltr">Hi,<div><br></div><div>  Is it possible to write both the stdout and stderr stream to the same output file/stream ?</div><div><br></div><div>  I am hoping to emulate</div><div><br></div><div>```</div><div>bp_stdout_stderr_app &gt; output.txt 2&gt;&amp;1<br>```</div><div><br></div><div>  I tried doing something like that but get a runtime error</div><div><br></div><div>Run output</div><div>```</div>terminate called after throwing an instance of &#39;boost::process::process_error&#39;<br>  what():  dup3() failed: Bad file descriptor<br>stdout : 000<br>stdout : 020<br>stdout : 040<br>Aborted (core dumped)<br><div>```</div><div><br></div><div>Source code</div><div>```</div>#include &lt;boost/process.hpp&gt;<br>#include &lt;iostream&gt;<br><br>using namespace boost::process;<br><br>int main()<br>{<br>    ipstream pipe_stream;<br>    child c(&quot;bp_stdout_stderr_app&quot;, std_out &gt; pipe_stream, std_err &gt; pipe_stream);<br><br>    std::string line;<br><br>    while (pipe_stream &amp;&amp; std::getline(pipe_stream, line) &amp;&amp; !line.empty())<br>        std::cerr &lt;&lt; line &lt;&lt; std::endl;<br><br>    c.wait();<br>}<br><div>```</div><div><br></div><div><br></div><div>Cheers<br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Nicholas Yue<br><a href="https://www.linkedin.com/in/nicholasyue/" target="_blank">https://www.linkedin.com/in/nicholasyue/</a><br></div></div></div></div>