Changeset 8071


Ignore:
Timestamp:
10/15/06 16:44:55 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8068 r8071  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2006/10/15 Thomas Bretz
     22
     23   * mbase/MEnv.[h,cc]:
     24     - implmenetd the possibility to check whether the given resource
     25       file eists
     26
     27   * star.cc, ganymed.c, callisto.cc:
     28     - implemented an error if the resource file doen't exist
     29       (returns 0xfe)
     30
     31
    2032
    2133 2006/10/15
  • trunk/MagicSoft/Mars/NEWS

    r8070 r8071  
    22
    33 *** <cvs>
     4
     5   - general: The programs now return 0xfe if the requested resource file
     6     doesn't exist.
    47
    58
  • trunk/MagicSoft/Mars/callisto.cc

    r8011 r8071  
    352352
    353353    MEnv env(kConfig);
     354    if (!env.IsValid())
     355    {
     356        gLog << err << "Configuration file " << kConfig << " not found." << endl;
     357        return 0xfe;
     358    }
     359
    354360    if (kModeC/* || kUseTest*/)
    355361    {
  • trunk/MagicSoft/Mars/ganymed.cc

    r8011 r8071  
    246246    //
    247247    MEnv env(kConfig);
     248    if (!env.IsValid())
     249    {
     250        gLog << err << "Configuration file " << kConfig << " not found." << endl;
     251        return 0xfe;
     252    }
    248253
    249254    MJCut job(Form("MJCut #%d", seq.GetNumAnalysis()));
  • trunk/MagicSoft/Mars/mbase/MEnv.cc

    r7808 r8071  
    4848
    4949using namespace std;
     50
     51//---------------------------------------------------------------------------
     52//
     53// (Default) constructor. If the given file cannot be accessed the data
     54// member fName is set to "" which can then be checked by IsValid()
     55//
     56MEnv::MEnv(const char *name) : TEnv(name), fName(name)
     57{
     58    fChecked.SetOwner();
     59
     60    if (fName.IsNull())
     61        return;
     62
     63    TString fname(name);
     64    gSystem->ExpandPathName(fname);
     65
     66    if (gSystem->AccessPathName(fname, kFileExists))
     67        fName = "";
     68}
    5069
    5170//---------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MEnv.h

    r7450 r8071  
    2626
    2727public:
    28     MEnv(const char *name="") : TEnv(name), fName(name) { fChecked.SetOwner(); }
     28    MEnv(const char *name="");
     29
     30    Bool_t      IsValid() const { return !fName.IsNull(); }
    2931
    3032    TObject    *Clone(const char *newname="") const;
  • trunk/MagicSoft/Mars/star.cc

    r8011 r8071  
    228228    //
    229229    MEnv env(kConfig);
     230    if (!env.IsValid())
     231    {
     232        gLog << err << "Configuration file " << kConfig << " not found." << endl;
     233        return 0xfe;
     234    }
     235
    230236    {
    231237        MJStar job(Form("MJStar #%d", seq.GetSequence()));
Note: See TracChangeset for help on using the changeset viewer.