Definition at line 4765 of file kernel.cpp.
◆ CommandOutput()
dunedaq::oks::CommandOutput::CommandOutput |
( |
const char * | command_name, |
|
|
const OksKernel * | k, |
|
|
std::string & | cmd ) |
Definition at line 4782 of file kernel.cpp.
4782 :
4784{
4785 p_file_name = get_temporary_dir() +
'/' + command_name +
'.' + std::to_string(getpid()) +
':' + std::to_string(
reinterpret_cast<std::uintptr_t
>(k)) +
".txt";
4786
4789}
const char * p_command_name
◆ ~CommandOutput()
dunedaq::oks::CommandOutput::~CommandOutput |
( |
| ) |
|
◆ cat2str()
std::string dunedaq::oks::CommandOutput::cat2str |
( |
| ) |
const |
Definition at line 4797 of file kernel.cpp.
4798{
4801
4802 if(f) {
4803 std::filebuf * buf =
f.rdbuf();
4804 while(true) {
4805 char c = buf->sbumpc();
4806 if(c == EOF) break;
4808 }
4809 }
4810
4812}
FELIX Initialization std::string initerror FELIX queue timed out
◆ check_command_status()
void dunedaq::oks::CommandOutput::check_command_status |
( |
int | status | ) |
|
Definition at line 4844 of file kernel.cpp.
4845{
4846 if (status == -1)
4847 {
4848 std::ostringstream text;
4851 }
4852 else if (int error_code = WEXITSTATUS(status))
4853 {
4854 std::ostringstream text;
4855 text <<
p_command.substr(0,
p_command.find_first_of(
' ')) <<
" exit with error code " << error_code <<
", output:\n" <<
cat2str();
4857 }
4858}
const std::string strerror(int error)
Convert C error number to string.
std::string cat2str() const
◆ file_name()
const std::string & dunedaq::oks::CommandOutput::file_name |
( |
| ) |
const |
|
inline |
◆ last_str()
std::string dunedaq::oks::CommandOutput::last_str |
( |
| ) |
const |
Definition at line 4815 of file kernel.cpp.
4816{
4818 std::string lastline;
4819
4821 {
4822 f.seekg(-1, std::ios_base::end);
4823 if (
f.peek() ==
'\n')
4824 {
4825 f.seekg(-1, std::ios_base::cur);
4826 for (
int i =
f.tellg(); i >= 0; i--)
4827 {
4828 if (
f.peek() ==
'\n')
4829 {
4831 break;
4832 }
4833 f.seekg(i, std::ios_base::beg);
4834 }
4835 }
4836
4837 getline(f, lastline);
4838 }
4839 return lastline;
4840}
◆ p_command
std::string& dunedaq::oks::CommandOutput::p_command |
◆ p_command_name
const char* dunedaq::oks::CommandOutput::p_command_name |
◆ p_file_name
std::string dunedaq::oks::CommandOutput::p_file_name |
The documentation for this struct was generated from the following file:
- /github/workspace/dunedaq/sourcecode/oks/src/kernel.cpp