|
subprocess 0.5.0
Modern subprocess library for c++
|
#include <ProcessBuilder.hpp>
Public Attributes | |
| PipeVar | cin = PipeOption::inherit |
| PipeVar | cout = PipeOption::inherit |
| PipeVar | cerr = PipeOption::inherit |
| bool | new_process_group = false |
| std::string | cwd |
| double | timeout = -1 |
| bool | check = false |
| EnvMap | env |
| PipeVar subprocess::RunOptions::cerr = PipeOption::inherit |
Option for cout, or handle to use.
if a pipe handle is used it will be made inheritable automatically before process is created. You must call pipe_close on your end.
if std::ostream* or FILE* is provided you are responsible for ensuring its lifetime outlasts the Popen.
If you would like to create the closest thing to a realtime filter do as follows:
pipe_read_some will return as soon as any data is available. Sometimes with 0. If you wish to do a proper wait for some data to be avialable, poll() is available on all platforms even windows. Popen.cerr is the raw handle you can use as the fd parameter to poll().
| bool subprocess::RunOptions::check = false |
Set to true for subprocess::run() to throw exception. Ignored when using Popen directly.
| PipeVar subprocess::RunOptions::cin = PipeOption::inherit |
Option for cin, data to pipe to cin. or created handle to use.
if a pipe handle is used it will be made inheritable automatically before process is created. You must call pipe_close on your end.
If std::istream* then you must make sure the life time of the stream is longer than Popen.
| PipeVar subprocess::RunOptions::cout = PipeOption::inherit |
Option for cout, or handle to use.
if a pipe handle is used it will be made inheritable automatically before process is created. You must call pipe_close on your end.
if std::ostream* or FILE* is provided you are responsible for ensuring its lifetime outlasts the Popen.
| std::string subprocess::RunOptions::cwd |
current working directory for new process to use
| EnvMap subprocess::RunOptions::env |
If empty inherits from current process
| bool subprocess::RunOptions::new_process_group = false |
Set to true to run as new process group
| double subprocess::RunOptions::timeout = -1 |
Timeout in seconds. Raise TimeoutExpired.
Only available if you use subprocess_run. If timeout is reached process is killed() SIGKILL style, TimeoutExpired is thrown.