26 void exec (
const std::string& cmd)
28 if (gSystem->Exec (cmd.c_str()) != 0)
39 RCU_THROW_MSG (
"command failed: " + cmd +
"\nwith output:\n" + result);
51 std::vector<char> buffer (1024);
54 pipe = popen (cmd.c_str(),
"r");
55 while ((
read = fread (&buffer[0], 1, buffer.size(), pipe)) > 0)
57 result.append (&buffer[0],
read);
72 std::string
quote (
const std::string& name)
75 for (std::string::const_iterator iter = name.begin(),
76 end = name.end(); iter != end; ++ iter)
78 if (!isalnum (*iter) && *iter !=
'/' && *iter !=
'.' &&
#define RCU_THROW_MSG(message)
std::string exec_read(const std::string &cmd)
effects: execute the given command and return the output returns: the output of the command guarantee...
void exec(const std::string &cmd)
effects: execute the given command guarantee: strong failures: out of memory II failures: system fail...
std::string quote(const std::string &name)
effects: quote the given name to protect it from the shell returns: the quoted name guarantee: strong...
This module defines a variety of assert style macros.
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)