From c996a0a50fac6e4228d6754a9f38913a67ed9301 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 30 May 2022 17:36:28 +0300 Subject: [PATCH] Remove old log file before the application start --- bin/runSalomeCommon.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/runSalomeCommon.py b/bin/runSalomeCommon.py index 7f3a05e0e..841f62a65 100755 --- a/bin/runSalomeCommon.py +++ b/bin/runSalomeCommon.py @@ -332,7 +332,15 @@ class CommonSessionServer(Server): pass pass if self.args['gui_log_file'] is not None: - self.SCMD2+=['--gui-log-file=%s'%self.args['gui_log_file']] + guilogfile = self.args['gui_log_file'] + if os.path.exists(guilogfile) and os.path.isfile(guilogfile): + try: + os.remove(guilogfile) + except: + print("Error: cannot remove existing log file", guilogfile) + guilogfile = None + if guilogfile is not None: + self.SCMD2+=['--gui-log-file=%s'%guilogfile] pass pass pass -- 2.39.2