From: jfa Date: Mon, 30 May 2022 14:36:28 +0000 (+0300) Subject: Remove old log file before the application start X-Git-Tag: V9_12_0a1~4^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fd185c12cae68766be634fc20abb85f78bb286c6;p=modules%2Fkernel.git Remove old log file before the application start --- 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