[][src]Crate unix_exec_output_catcher

This library lets you execute a child process and catch its output (stdout and stderr). This is useful if you want to use the output from a specific command and transform it in your program.

std::process::Command already covers this. 🚨 I didn't know this when I created this lib. So better use that instead and take this source code as educational information how it could be done.

Structs

ProcessOutput

Holds the text output lines for stdout and stderr of the executed child process. The stdcombined-property holds both combined in the order they appeared.

Functions

fork_exec_and_catch

Executes a program in a child process and returns the output of STDOUT and STDERR line by line in a vector. Be aware that this is blocking and static! So if your executable produces 1GB of output text, the data of the vectors of the returned structs are 1GB in size.