Hi,
On 18 April 2016 at 17:35, Klemens Morgenstern
Hi,
I am currently working on a new version (0.6) of boost.process which mainly provides a new interface. Most of the underlying features have be derived from the older boost.process version. By doing all this, I tried to hide basically all platform-specifics, so that no #ifdefs are required as in 0.5. It is somewhat inspired by python and std::thread.
I really hope this can help to make boost.process an official library.
Thanks for doing this effort, I believe that it is much needed indeed.
At the current state, I have all functionality in the library that I want, but it's not polished at all. Also it of course needs more tests and documentation. But I think it sufficient to get the basic idea.
You can check it out here: https://github.com/klemens-morgenstern/boost-process/tree/develop And the little documentation it has is found here: http://klemens-morgenstern.github.io/process/
Additionally here are the development notes: https://github.com/klemens-morgenstern/boost-process/issues/2
At the current state, the tests pass on linux as well as windows (gcc-5 & MSVC-14). Requirements are C++, boost.fusion, boost.asio, boost.iostreams, boost.filesystem and boost.system.
I started reading the documentation but before getting into details, could you clarify if Boost.Asio is required even if you don't use communication with the child processes? We have a few tricky cases related to child process management on Windows, in particular when trying to end a child process "cleanly" when it is console program. I'll have to check if you managed to fix the issues we are seeing, in which case this solution would be better than the hackish one we have.
I really could use some feedback and hope you're interested.
Sincerely,
Klemens
Here's some sample code:
child c = execute("program", "param1", std_err > "error.log");
And to show off a little: Or you can modify the environment read the output into a future, write the input via pipe and redirect stderr to null.
std::futurestd::string fut; process::pipe p; asio::io_service io_service; auto c = execute("other-prog", std_out > fut, std_in < p; std_err > null; env["PATH"]+="/tmp", env["BOOST_VERSION"]="1.61", io_service);
iostreams::streamsiostreams::file_descriptor_sink str(p.sink());
The child class binds the subprocess analogue to an std::thread, i.e. it will wait for the process to finished. It can be detached, terminated and waited for.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost