From 098bce4ba91962de1065c296887fb7d6536e94d6 Mon Sep 17 00:00:00 2001
From: Michael <m.langguth@fz-juelich.de>
Date: Mon, 8 Jun 2020 10:15:14 +0200
Subject: [PATCH] Some further corrections in path-handling of
 write_metadata_to_file-method.

---
 metadata.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/metadata.py b/metadata.py
index 564a2d2d..5bb01db0 100644
--- a/metadata.py
+++ b/metadata.py
@@ -173,11 +173,12 @@ class MetaData:
             meta_dict["variables"] = {"var"+str(i+1) : self.varnames[i]}
         
         # create directory if required
-        if not os.path.exists(self.expdir):
+        target_dir = os.path.join(self.expdir,self.expname)
+        if not os.path.exists(target_dir):
             print("Created experiment directory: '"+self.expdir+"'")
-            os.make_dirs(self.exp_dir,exist_ok=True)            
+            os.make_dirs(target_dir,exist_ok=True)            
             
-        meta_fname = os.path.join(self.expdir,os.path.join(self.expname,"metadata.json"))
+        meta_fname = os.path.join(target_dir,"metadata.json")
         
         # write dictionary to file
         with open(meta_fname) as js_file:
-- 
GitLab