Definition at line 739 of file mlogger.cxx.
◆ WriterPopen()
| WriterPopen::WriterPopen |
( |
LOG_CHN * |
log_chn, |
|
|
const char * |
pipe_command, |
|
|
const char * |
file_ext |
|
) |
| |
|
inline |
Definition at line 742 of file mlogger.cxx.
743 {
745 printf(
"WriterPopen: path [%s]\n", log_chn->
path.c_str());
750 }
◆ ~WriterPopen()
| WriterPopen::~WriterPopen |
( |
| ) |
|
|
inline |
Definition at line 752 of file mlogger.cxx.
753 {
755 printf("WriterPopen: destructor\n");
759 }
◆ wr_close()
| int WriterPopen::wr_close |
( |
LOG_CHN * |
log_chn, |
|
|
int |
run_number |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 831 of file mlogger.cxx.
832 {
833 int err;
834
836 printf(
"WriterPopen: close path [%s]\n", log_chn->
path.c_str());
837
839
841
842#ifdef OS_WINNT
843
845#else
848
849 if (err != 0) {
850 cm_msg(
MERROR,
"WriterPopen::wr_close",
"Cannot write to pipe \'%s\', pclose() returned %d, errno %d (%s)",
fCommand.c_str(), err, errno, strerror(errno));
852 }
853
854 chmod(log_chn->
path.c_str(), 0444);
855
857
859#endif
860 }
double ss_file_size(const char *path)
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
◆ wr_get_chain()
| std::string WriterPopen::wr_get_chain |
( |
| ) |
|
|
inlinevirtual |
◆ wr_get_file_ext()
| std::string WriterPopen::wr_get_file_ext |
( |
| ) |
|
|
inlinevirtual |
◆ wr_open()
| int WriterPopen::wr_open |
( |
LOG_CHN * |
log_chn, |
|
|
int |
run_number |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 761 of file mlogger.cxx.
762 {
765
767 printf(
"WriterPopen: open path [%s] pipe [%s] ext [%s]\n", log_chn->
path.c_str(),
fPipeCommand.c_str(),
fFileExt.c_str());
768
770
773
774#ifdef OS_WINNT
775
777#else
779
782 cm_msg(
MERROR,
"WriterPopen::wr_open",
"Cannot write to pipe \'%s\', popen() errno %d (%s)",
fCommand.c_str(), errno, strerror(errno));
784 }
785
787
789#endif
790 }
static bool check_file_exists(const char *filename)
◆ wr_write()
| int WriterPopen::wr_write |
( |
LOG_CHN * |
log_chn, |
|
|
const void * |
data, |
|
|
const int |
size |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 792 of file mlogger.cxx.
793 {
795 printf(
"WriterPopen: write path [%s], size %d\n", log_chn->
path.c_str(), size);
796
797 if (size == 0)
799
802 }
803
805
806 int wr = fwrite(
data, 1, size,
fFp);
807
808
809
810
811 if (wr != size) {
812 cm_msg(
MERROR,
"WriterPopen::wr_write",
"Cannot write to pipe \'%s\', fwrite(%d) returned %d, errno %d (%s)",
fCommand.c_str(), size, wr, errno, strerror(errno));
813
814 if (errno == EPIPE) {
815 cm_msg(
MERROR,
"WriterPopen::wr_write",
"Cannot write to pipe \'%s\': broken pipe, closing the pipe",
fCommand.c_str());
817 }
818
820 }
821
822 time_t now = time(NULL);
826 }
827
829 }
int wr_close(LOG_CHN *log_chn, int run_number)
◆ fCommand
| std::string WriterPopen::fCommand |
|
private |
◆ fFileExt
| std::string WriterPopen::fFileExt |
|
private |
◆ fFp
◆ fLastCheckTime
| time_t WriterPopen::fLastCheckTime |
|
private |
◆ fPipeCommand
| std::string WriterPopen::fPipeCommand |
|
private |
The documentation for this class was generated from the following file: