From 2cce88334b9b7ac938b35c67c14b0e86e6e7b968 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 a31aee6d9..6578e3f95 100755 --- a/bin/runSalomeCommon.py +++ b/bin/runSalomeCommon.py @@ -302,7 +302,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