
Hello Boris, To portably use boost::process::behavior::inherit, it should call in it's constructor: #if defined(BOOST_WINDOWS_API) if(h_.native()) { if (!SetHandleInformation( h_.native() , HANDLE_FLAG_INHERIT , HANDLE_FLAG_INHERIT)) BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR( "SetHandleInformation() failed"); } #endif Otherwise the following use case fails on Windows to redirect output to a file: void inherit_test (std::string exe, const args& a, std::string out, std::string err) { boost::iostreams::file_descriptor_sink stdOutFile; boost::iostreams::file_descriptor_sink stdErrFile; boost::process::context ctx; if (!out.empty()) { stdOutFile.open(out.c_str()); ctx.streams[boost::process::stdout_id] = boost::process::behavior::inherit(stdOutFile.handle()); } if (!standardErrorFile.empty()) { stdErrFile.open(err.c_str()); ctx.streams[boost::process::stderr_id] = boost::process::behavior::inherit(stdErrFile.handle()); } boost::process::child c = boost::process::create_child(exe, a, ctx); c.wait(); } Jeff