18 inline int call_program(
const std::string& commandline, std::string& stdout,
bool print_to_stdout =
false) {
19 FILE* pipe = popen(commandline.c_str(),
"r");
22 if (fgets(buf,
sizeof(buf), pipe) !=
nullptr) {
24 if (print_to_stdout) {
int call_program(const std::string &commandline, std::string &stdout, bool print_to_stdout=false)
Runs an external program from some command line and records the output to stdout.