I need to execute a program and retrieve its stdout output in c++. I'd like my code to be cross-platform too.
Having recently discovered the wonderful world of the Boost c++ libraries for all your cross platform needs, I figured I'd just go to boost.org and read up on the documentation of Boost.Process. Much to my surprise, it wasn't there! I then proceeded to figure out what name Boost gave their cross-platform library to start external processes, but haven't managed to find it so far.
A Google search brought me to Julio M. Merino Vidal's Boost.Process, which seems to be the unofficial Boost library I was looking for. Strangely enough, I cannot seem to find a download link on that website. It also seems like there haven't been any recent developments regarding the project.
I was finally able to find a download link for Vidal's Boost.Process on an external site and will use that for now, but I'm quite amazed at the effort I had to put in to get my hands on a cross platform c++ library to interact with external processes.
So, why is there no official Boost.Process? It seems like it would be a very valuable addition. Or am I totally overlooking the obvious solution here? Could you perhaps suggest other cross-platform libraries for managing simple starting of and interation with external processes?
Boost. Process is a library to manage system processes. It can be used to: create child processes. setup streams for child processes.
Boost Process is header-only, so you don't have to compile it separately.
Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains 164 individual libraries (as of version 1.76).
Boost is proven to be a nourishing beverage that helps build stamina. Boost has nutrients which help in maintenance of optimal bone & muscle strength. Boost is enriched with envita nutrients (iron, Vitamin A, C, folic acid, B12 and B6). Envita nutrients help transport oxygen more effectively in the body.
Boost.Process was accepted for inclusion into Boost on November 9, 2016; and has been included in the 1.64 released on April 19, 2017. Boost.Process is now an official Boost library!
It's documentation is available here: http://www.boost.org/doc/libs/1_64_0/doc/html/process.html
For the record, the sources that were reviewed from October 27, 2016 through November 5, 2016 are available on GitHub:
download: https://github.com/klemens-morgenstern/boost-process
manual: http://klemens-morgenstern.github.io/process/index.html
You can find on the web several older versions of this library. They are all more or less incompatible:
download: http://www.highscore.de/boost/process0.5/process.zip
manual: http://www.highscore.de/boost/process0.5/index.html
download: http://www.highscore.de/boost/gsoc2010/process.zip
manual: http://www.highscore.de/boost/gsoc2010/
download: http://www.highscore.de/boost/process.zip
manual1: http://www.highscore.de/boost/process/
manual2: http://www.highscore.de/cpp/process/
I think it is the same as in http://svn.boost.org/svn/boost/sandbox/process/boost/
download: https://github.com/boost-vault/Process
download: http://www.netbsd.org/~jmmv/process.zip
manual: http://www.netbsd.org/~jmmv/process/
There are other version that look like branches: https://github.com/JeffFlinn/boost-process and https://github.com/boost-vault/Process.
For a partial history of the project, look at http://www.highscore.de/cpp/process/#introduction
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With