From 1f7167ac26f3e34b32bd2ddc313b37e70ac4a097 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 10 Sep 2009 09:20:36 +0000 Subject: [PATCH] windows port --- bin/salome_utils.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/bin/salome_utils.py b/bin/salome_utils.py index f81107d3c..08407f420 100644 --- a/bin/salome_utils.py +++ b/bin/salome_utils.py @@ -363,7 +363,13 @@ def makeTmpDir( path, mode=0777 ): """ import os if os.path.exists( path ): - os.system( "rm -rf " + path + "/*" ) + import sys + if sys.platform == "win32": + os.system( "rmdir /S /Q " + path ) + os.system( "mkdir " + path ) + else: + os.system( "rm -rf " + path + "/*" ) + pass pass else: dirs = path.split("/") @@ -412,10 +418,20 @@ def uniteFiles( src_file, dest_file ): dest.writelines( dest_lines ) dest.close() - command = "cat " + src_file + " >> " + dest_file + import sys + if sys.platform == "win32": + command = "type " + src_file + " >> " + dest_file + else: + command = "cat " + src_file + " >> " + dest_file + pass pass else: - command = "cp " + src_file + " " + dest_file + import sys + if sys.platform == "win32": + command = "copy " + src_file + " " + dest_file + " > nul" + else: + command = "cp " + src_file + " " + dest_file + pass pass os.system( command ) -- 2.39.2