Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8992)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8993)
@@ -25,6 +25,8 @@
      - this made local functions obsolete
      - added new format 20080519 including telescope- and file-number
-     - simplified the if-clauses testing for version numbers (due to the
-       initial check only some version numbers allowed anyway)
+     - simplified the if-clauses testing for version numbers (due to
+       the initial check only some version numbers allowed anyway)
+     - check for the combination of telescope-, run- and file-number 
+       to be unique.
 
 
Index: trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C	(revision 8992)
+++ trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C	(revision 8993)
@@ -139,5 +139,5 @@
     while (1)
     {
-        Int_t telnumber = 1;
+        Int_t telnumber = 1; // FIXME: "NULL"?
         if (version >=200805190)
         {
@@ -174,5 +174,5 @@
         }
 
-        Int_t filenumber = 0;
+        Int_t filenumber = 0; // FIXME: "NULL"?
         if (version >=200805190)
         {
@@ -181,8 +181,11 @@
         }
 
-        if (serv.ExistStr("fRunNumber", "RunData", strng))
-        {
-            // FIXME: Maybe we can implement an switch to update mode?
-            cout << "Run #" << runnumber << " already existing... skipped." << endl;
+        TString where = Form("((fTelescopeNumber=%d AND fFileNumber=%d) OR"
+                             "(ISNULL(fTelescopeNumber) AND ISNULL(fFileNumber)))",
+                             telnumber, filenumber);
+        if (serv.ExistStr("fRunNumber", "RunData", strng, where))
+        {
+            // FIXME: Maybe we can implement a switch to update mode?
+            cout << "Entry M" << telnumber << ":" << runnumber << "/" << filenumber << " already existing... skipped." << endl;
             strng.ReadLine(fin);
             continue;
