Ignore:
Timestamp:
08/18/04 11:21:29 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/sql/filldotrun.C

    r4601 r4680  
    4747//   "/data/MAGIC/Period019/ccdata"             would do it for one Period
    4848//   "/data/MAGIC/Period019/ccdata/2004_05_17"  would do it for a single day
     49//   "/data/MAGIC/Period019/ccdata/file.run"    would do it for a single file
    4950//
    5051// The second argument is the 'dummy-mode'. If it is kTRUE dummy-mode is
     
    6364//   root -q -l -b filldotrun.C+\(\"path\"\,kFALSE\) 2>&1 | tee filldotrun.log
    6465//
     66// Returns 0 in case of failure and 1 in case of success.
     67//
    6568/////////////////////////////////////////////////////////////////////////////
    6669#include <iostream>
     
    152155{
    153156    ifstream fin(filename);
     157    if (!fin)
     158    {
     159        cout << "Could not open file " << fname << endl;
     160        return -1;
     161    }
    154162
    155163    TString strng;
     
    160168        cout << "First Line: " << strng << endl;
    161169        cout << endl;
    162         return 0;
     170        return -1;
    163171    }
    164172
     
    175183        cout << "Second Line: " << strng << endl;
    176184        cout << endl;
    177         return 0;
     185        return -1;
    178186    }
    179187
     
    387395        {
    388396            cout << query << " - FAILED!" << endl;
    389             continue;
     397            return -1;
    390398        }
    391399
     
    413421    cout << endl;
    414422
     423    if (path.EndsWith(".run"))
     424    {
     425        cout << name(TRegexp("CC_.*.run", kFALSE)) << flush;
     426        Int_t n = insert(serv, dummy, name);
     427        cout << " <" << n << "> " << (dummy?"DUMMY":"") << endl;
     428
     429        return n<0 ? 0 : 1;
     430    }
     431
    415432    MDirIter Next(path, "CC_*.run", -1);
    416433    while (1)
     
    421438
    422439        cout << name(TRegexp("CC_.*.run", kFALSE)) << flush;
    423 
    424440        Int_t n = insert(serv, dummy, name);
    425 
    426441        cout << " <" << n << "> " << (dummy?"DUMMY":"") << endl;
    427     }
     442
     443        if (n<0)
     444            return 0;
     445    }
     446
     447    return 1;
    428448}
Note: See TracChangeset for help on using the changeset viewer.