Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8070)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8071)
@@ -18,4 +18,16 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2006/10/15 Thomas Bretz
+
+   * mbase/MEnv.[h,cc]:
+     - implmenetd the possibility to check whether the given resource
+       file eists
+
+   * star.cc, ganymed.c, callisto.cc:
+     - implemented an error if the resource file doen't exist
+       (returns 0xfe)
+
+
 
  2006/10/15
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 8070)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 8071)
@@ -2,4 +2,7 @@
 
  *** <cvs>
+
+   - general: The programs now return 0xfe if the requested resource file
+     doesn't exist.
 
 
Index: /trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- /trunk/MagicSoft/Mars/callisto.cc	(revision 8070)
+++ /trunk/MagicSoft/Mars/callisto.cc	(revision 8071)
@@ -352,4 +352,10 @@
 
     MEnv env(kConfig);
+    if (!env.IsValid())
+    {
+        gLog << err << "Configuration file " << kConfig << " not found." << endl;
+        return 0xfe;
+    }
+
     if (kModeC/* || kUseTest*/)
     {
Index: /trunk/MagicSoft/Mars/ganymed.cc
===================================================================
--- /trunk/MagicSoft/Mars/ganymed.cc	(revision 8070)
+++ /trunk/MagicSoft/Mars/ganymed.cc	(revision 8071)
@@ -246,4 +246,9 @@
     //
     MEnv env(kConfig);
+    if (!env.IsValid())
+    {
+        gLog << err << "Configuration file " << kConfig << " not found." << endl;
+        return 0xfe;
+    }
 
     MJCut job(Form("MJCut #%d", seq.GetNumAnalysis()));
Index: /trunk/MagicSoft/Mars/mbase/MEnv.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 8070)
+++ /trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 8071)
@@ -48,4 +48,23 @@
 
 using namespace std;
+
+//---------------------------------------------------------------------------
+//
+// (Default) constructor. If the given file cannot be accessed the data
+// member fName is set to "" which can then be checked by IsValid()
+//
+MEnv::MEnv(const char *name) : TEnv(name), fName(name)
+{
+    fChecked.SetOwner();
+
+    if (fName.IsNull())
+        return;
+
+    TString fname(name);
+    gSystem->ExpandPathName(fname);
+
+    if (gSystem->AccessPathName(fname, kFileExists))
+        fName = "";
+}
 
 //---------------------------------------------------------------------------
Index: /trunk/MagicSoft/Mars/mbase/MEnv.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MEnv.h	(revision 8070)
+++ /trunk/MagicSoft/Mars/mbase/MEnv.h	(revision 8071)
@@ -26,5 +26,7 @@
 
 public:
-    MEnv(const char *name="") : TEnv(name), fName(name) { fChecked.SetOwner(); }
+    MEnv(const char *name="");
+
+    Bool_t      IsValid() const { return !fName.IsNull(); }
 
     TObject    *Clone(const char *newname="") const;
Index: /trunk/MagicSoft/Mars/star.cc
===================================================================
--- /trunk/MagicSoft/Mars/star.cc	(revision 8070)
+++ /trunk/MagicSoft/Mars/star.cc	(revision 8071)
@@ -228,4 +228,10 @@
     //
     MEnv env(kConfig);
+    if (!env.IsValid())
+    {
+        gLog << err << "Configuration file " << kConfig << " not found." << endl;
+        return 0xfe;
+    }
+
     {
         MJStar job(Form("MJStar #%d", seq.GetSequence()));
