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;