Fork me on GitHub

Changeset 18 in svn


Ignore:
Timestamp:
Nov 6, 2008, 5:23:12 PM (16 years ago)
Author:
Xavier Rouby
Message:

checks that the input file is present

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/HEPEVTConverter.cc

    r2 r18  
    158158      TChain *chain = new TChain("h101");
    159159      infile >> buffer;
     160        ifstream checking_the_file(buffer.c_str());
     161        if(!checking_the_file.good()) { cout << buffer << ": file not found\n"; continue;}
     162        else checking_the_file.close();
     163
    160164      if(!infile.good()) break;
    161165      chain->Add(buffer.c_str());
  • trunk/src/LHEFConverter.cc

    r2 r18  
    9797      infile >> filename;
    9898      if(!infile.good()) break;
     99        ifstream checking_the_file(filename.c_str());
     100        if(!checking_the_file.good()) { cout << filename << ": file not found\n"; continue;}
     101        else checking_the_file.close();
    99102
    100103      // Create the Reader object:
  • trunk/src/STDHEPConverter.cc

    r2 r18  
    115115      infile >> filename;
    116116      if(!infile.good()) break;
     117        ifstream checking_the_file(filename.c_str());
     118        if(!checking_the_file.good()) { cout << filename << ": file not found\n"; continue;}
     119        else checking_the_file.close();
    117120     
    118121      ierr = StdHepXdrReadInit(const_cast<char*>(filename.c_str()), &nevt, istr);
Note: See TracChangeset for help on using the changeset viewer.