25#ifndef TIMEMORY_UTILITY_LAUNCH_PROCESS_CPP_
26#define TIMEMORY_UTILITY_LAUNCH_PROCESS_CPP_ 1
40#if !defined(TIMEMORY_WINDOWS)
56 _args.at(1) = (
char*) _c.c_str();
64 ss <<
"[timemory]> Error launching command: '" <<
cmd <<
"'... " <<
extra;
65 perror(ss.str().c_str());
77 ss <<
"[timemory]> Command: '" <<
cmd <<
"' returned a non-zero exit code: " <<
ec
79 perror(ss.str().c_str());
83 if(std::system(
nullptr) != 0)
85 int ec = std::system(
cmd);
90 "[timemory]> Command: '%s' returned a non-zero exit code: %i... %s\n",
97 fprintf(stderr,
"std::system unavailable for command: '%s'... %s\n",
cmd,
TIMEMORY_PIPE * popen(const char *path, char **argv, char **envp)
std::ostream & flush_output(std::ostream &os, TIMEMORY_PIPE *proc, int max_counter)
int pclose(TIMEMORY_PIPE *p)
std::array< char *, 4 > _args
TIMEMORY_UTILITY_LINKAGE(bool) launch_process(const char *cmd
const std::string & extra
tim::mpl::apply< std::string > string
tim::popen::TIMEMORY_PIPE * fp
const std::string std::ostream * os
bool launch_process(const char *cmd, const std::string &extra="", std::ostream *os=nullptr)
ContainerT delimit(const std::string &line, const std::string &delimiters="\"',;: ", PredicateT &&predicate=[](const std::string &s) -> std::string { return s;})