31 std::string
exec(
const std::string & _cmd) {
32 FILE* pipe = popen(_cmd.c_str(),
"r");
33 REQUIRE(pipe,
"could not start " << _cmd);
35 std::string result =
"";
36 while(feof(pipe) == 0) {
37 if(fgets(buffer, 128, pipe) !=
nullptr) {
45 void exec(
const std::string & _cmd,
const std::string &_stdin) {
46 FILE* pipe = popen(_cmd.c_str(),
"w");
47 REQUIRE(pipe,
"could not start " << _cmd);
48 fputs(_stdin.c_str(), pipe);
Header file for CHECK and REQUIRE macros.
The main namespace of xerus.
std::string exec(const std::string &_cmd)
Execute a given command.
Header file for some helper functions.
Header file for comfort functions and macros that should not be exported in the library.