10#include "include/fun.h"
16 vector<string> fnames;
19 "JobOutputDir=`/bin/ls -dt1 joboutput-* 2>/dev/null | head -1`\n"
20 "if [ -d \"${JobOutputDir}\" ]; then\n"
21 " find ${JobOutputDir} -name hist.root\n"
25 stringstream fnstream;
27 char* fnbuf =
new char[1024];
28 FILE* fstream = popen(command.c_str(),
"r");
30 while ( fgets(fnbuf, 1024, fstream) != NULL ) {
35 while ( ! (fnstream>>fname).eof() ) {
36 fnames.push_back(fname);
42 if ( fnames.empty() ) {
43 cout <<
"WARNING: Failed to retrieve hist files in the current directory!" << endl;
51 vector<string> fnames;
52 string newpath = path;
53 string::size_type strl = newpath.length();
54 if((strl>1) && (
'/'==newpath[strl-1])) newpath.erase(strl-1);
57 sprintf(com1,
"JobOutputDir=`/bin/ls -dt1 %s/joboutput-* 2>/dev/null | head -1`\n", newpath.c_str());
58 string command1(com1);
60 "if [ -d \"${JobOutputDir}\" ]; then\n"
61 " find ${JobOutputDir} -name hist.root\n"
64 string command = command1 + command2;
65 stringstream fnstream;
67 char* fnbuf =
new char[1024];
68 FILE* fstream = popen(command.c_str(),
"r");
70 while ( fgets(fnbuf, 1024, fstream) != NULL ) {
75 while ( ! (fnstream>>fname).eof() ) {
76 fnames.push_back(fname);
82 if ( fnames.empty() ) {
83 cout <<
"ERROR: Failed to retrieve hist files!" << endl;
vector< string > getHistList()