Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 9470)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 9471)
@@ -19,4 +19,14 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2009/07/01 Thomas Bretz
+
+   * mreport/MReportDrive.cc:
+     - fixed typo in version number
+
+   * mjobs/MJob.cc:
+     - improved check for write permissions
+
+
+
  2009/06/28 Daniel Hoehne-Moench
 
@@ -111,4 +121,10 @@
      - fixed the decoding for runs for which L1TPU was connected
        instead of L1
+
+   * megom/MGeomCamFact.[h,cc]:
+     - added
+
+   * megom/Makefile, mgeom/GeomLinkDef.h:
+     - added MGeomCamFact
 
 
Index: /trunk/MagicSoft/Mars/mjobs/MJob.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJob.cc	(revision 9470)
+++ /trunk/MagicSoft/Mars/mjobs/MJob.cc	(revision 9471)
@@ -401,5 +401,38 @@
     const Bool_t exists = !gSystem->AccessPathName(fname, kFileExists);
     if (!exists)
+    {
+        const TString dirname = gSystem->DirName(fname);
+
+        Long_t flags;
+        const Bool_t exists2 = !gSystem->GetPathInfo(dirname, 0, (Long_t*)0, &flags, 0);
+        if (!exists2)
+        {
+            *fLog << err << "ERROR - Directory " << dirname << " doesn't exist." << endl;
+            return kFALSE;
+        }
+
+        if (flags&2==0)
+        {
+            *fLog << err << "ERROR - " << dirname << " is not a directory." << endl;
+            return kFALSE;
+        }
+
+        const Bool_t write = !gSystem->AccessPathName(dirname, kWritePermission);
+        if (!write)
+        {
+            *fLog << err << "ERROR - No permission to write to directory " << dirname << endl;
+            return kFALSE;
+        }
+
         return kTRUE;
+    }
+
+    Long_t flags;
+    gSystem->GetPathInfo(fname, 0, (Long_t*)0, &flags, 0);
+    if (flags&4)
+    {
+        *fLog << err << "ERROR - " << fname << " is not a regular file." << endl;
+        return kFALSE;
+    }
 
     const Bool_t write = !gSystem->AccessPathName(fname, kWritePermission);
