c++stdio

Cross-platform way to start a process and redirect its stdio


I would like to know if there is a cross-platform (Windows, Linux, BSD) library with which I could start a process asynchronously and have iostream-like wrappers for its standard pipes.

I would like it to be able to be able to tell when the process has terminated.

Thank you.


Solution

  • There are 2 libraries you can use:

    QProcess

    You can use QProcess class from Qt toolkit. More information can be found on this stackoverflow question and qt library.

    libexecstream

    This library is lighter than Qt, and is cross-platform

    Others