Skip to content
Snippets Groups Projects

Allow as input ROOT file from ZIP archives

Merged Florian Uhlig requested to merge f.uhlig/cbmroot:fix_cbmplutogenerator into master
All threads resolved!
+ 16
2
@@ -179,12 +179,26 @@ void CbmPlutoGenerator::CloseInput() {
// ------------------------------------------------------------------------
void CbmPlutoGenerator::CheckFileExist(std::string filename) {
// Extract the filename of the zip file in case the real root file
+1
// is packed into a zip file. The delimiter between the two file
// names is a hash (#).
// For the time being we don't check if the root file really exist in
// the zip file since we don't know how to do the check
std::string checkFilename {""};
std::size_t found = filename.find("#");
if (found != std::string::npos) {
checkFilename = filename.substr(0, found);
} else {
checkFilename = filename;
}
struct stat buffer;
if (stat(filename.c_str(), &buffer) == 0) {
if (stat(checkFilename.c_str(), &buffer) == 0) {
LOG(info) << "CbmPlutoGenerator: Add file " << filename
<< " to input chain";
} else {
LOG(fatal) << "Input File " << filename << " not found";
LOG(fatal) << "Input File " << checkFilename << " not found";
}
}
Loading