Index: trunk/MagicSoft/Mars/mbase/MEnv.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 8673)
+++ trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 8674)
@@ -71,4 +71,14 @@
     if (GetEntries()<=0 && !fname.IsNull() && fname!=name)
         ReadFile(fname, kEnvLocal);;
+}
+
+//---------------------------------------------------------------------------
+//
+// Make sure that the name used for writing doesn't contain a full path
+//
+const char *MEnv::GetName() const
+{
+    const char *pos = strrchr(GetRcName(), '/');
+    return pos>0 ? pos+1 : GetRcName();
 }
 
@@ -847,4 +857,15 @@
 //---------------------------------------------------------------------------
 //
+// Add name and full path to output
+//
+void MEnv::PrintEnv(EEnvLevel level) const
+{
+    cout << "# Path: " << GetRcName() << endl;
+    cout << "# Name: " << GetName() << endl;
+    TEnv::PrintEnv(level);
+}
+
+//---------------------------------------------------------------------------
+//
 // Print resources which have never been touched (for debugging)
 //
Index: trunk/MagicSoft/Mars/mbase/MEnv.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEnv.h	(revision 8673)
+++ trunk/MagicSoft/Mars/mbase/MEnv.h	(revision 8674)
@@ -38,5 +38,5 @@
     const char *GetValue(const char *name, const char *dflt);
 
-    const char *GetName() const { return GetRcName(); }
+    const char *GetName() const { return strrchr(GetRcName(), '/')?strrchr(GetRcName(), '/')+1:GetRcName(); }
 
     Int_t       GetColor(const char *name, Int_t dftl);
@@ -67,6 +67,7 @@
     void        AddEnv(const TEnv &env, Bool_t overwrite=kTRUE);
 
+    void        PrintEnv(EEnvLevel level = kEnvAll) const;
     void        Print(Option_t *option) const { TEnv::Print(option); }
-    void        Print() const { TEnv::PrintEnv(kEnvLocal); } //*MENU*
+    void        Print() const { PrintEnv(kEnvLocal); } //*MENU*
 
     void PrintUntouched() const;
