From 3db0c04fe162a265f6f5f7297de4faae41a84d94 Mon Sep 17 00:00:00 2001
From: madsmpedersen <m@madsp.dk>
Date: Wed, 6 Apr 2016 11:43:59 +0200
Subject: [PATCH] bug fix

---
 wetb/hawc2/simulation.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/wetb/hawc2/simulation.py b/wetb/hawc2/simulation.py
index 371cd514..37ad3c39 100755
--- a/wetb/hawc2/simulation.py
+++ b/wetb/hawc2/simulation.py
@@ -280,6 +280,8 @@ class SimulationThread(Thread):
             p.set_nice(psutil.BELOW_NORMAL_PRIORITY_CLASS)
         self.process.communicate()
         errorcode = self.process.returncode
+        if not os.path.isdir(os.path.dirname(self.modelpath + self.sim.stdout_filename)):
+            os.makedirs(os.path.dirname(self.modelpath + self.sim.stdout_filename))
         with open(self.modelpath + self.sim.stdout_filename, encoding='utf-8') as fid:
             stdout = fid.read()
         self.res = errorcode, stdout
-- 
GitLab