From 79ec3128d9f101c6f0f179794874603867ab57aa Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 3 Aug 2009 15:17:14 +0000 Subject: [PATCH] windows port --- src/Container/SALOME_ContainerManager.cxx | 15 +++++++++++++-- src/KERNEL_PY/salome_test.py | 12 +++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 5deda9075..cc3a42c7b 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -317,8 +317,19 @@ SALOME_ContainerManager::StartContainer(const Engines::MachineParameters& params command = BuildCommandToLaunchRemoteContainer(theMachine,params,container_exe); //redirect stdout and stderr in a file - string logFilename="/tmp/"+_NS->ContainerName(params)+"_"+ theMachine +"_"+getenv( "USER" )+".log" ; - command += " > " + logFilename + " 2>&1 &"; +#ifdef WNT + string logFilename=getenv("TEMP"); + logFilename += "\\"; +#else + string logFilename="/tmp/"; +#endif + logFilename += _NS->ContainerName(params)+"_"+ theMachine +"_"+getenv( "USER" )+".log" ; + command += " > " + logFilename + " 2>&1"; +#ifdef WNT + command = "%PYTHONBIN% -c \"import win32pm ; win32pm.spawnpid(r'" + command + "', '')\""; +#else + command += " &"; +#endif // launch container with a system call int status=system(command.c_str()); diff --git a/src/KERNEL_PY/salome_test.py b/src/KERNEL_PY/salome_test.py index a62cbafe9..e0aab705c 100755 --- a/src/KERNEL_PY/salome_test.py +++ b/src/KERNEL_PY/salome_test.py @@ -479,7 +479,11 @@ import VISU import visu_gui medFileName = "pointe.med" -medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFileName +if sys.platform != "win32": + medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFileName +else: + medFile = os.getenv('DATA_DIR') + '\\MedFiles\\' + medFileName + pass print "Load ", medFile studyCurrent = salome.myStudyName @@ -494,7 +498,7 @@ try: if sys.platform != "win32": tmpDir = "/tmp/" else: - tmpDir = os.getenv('TEMP') + '/' + tmpDir = os.getenv('TEMP') + '\\' medFileNew = tmpDir + str(random.randint(0,1000000)) + "_" + medFileName print " -- Copy " + medFile + " to " + medFileNew @@ -505,7 +509,9 @@ try: os.system(copyCommand + " " + medFile + " " + medFileNew) medFile = medFileNew - os.system("chmod 755 " + medFile) + if sys.platform != "win32": + os.system("chmod 755 " + medFile) + pass if os.access(medFile, os.W_OK) : med_comp.readStructFileWithFieldType(medFile,studyCurrent) -- 2.39.2