From 8488aaa27b31a492e36bbd847a8ff5ba4690622f Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 18 Sep 2006 08:17:13 +0000 Subject: [PATCH] Bug SWP13450 : Using of 'cp' command is incorrect --- src/KERNEL_PY/salome_test.py | 14 ++++++++++++-- src/ResourcesManager/SALOME_ResourcesManager.cxx | 4 ++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/KERNEL_PY/salome_test.py b/src/KERNEL_PY/salome_test.py index 9fb6b3489..d18c706e2 100755 --- a/src/KERNEL_PY/salome_test.py +++ b/src/KERNEL_PY/salome_test.py @@ -466,9 +466,19 @@ try: if os.access(medFile, os.R_OK) : if not os.access(medFile, os.W_OK) : import random - medFileNew = "/tmp/" + str(random.randint(0,1000000)) + "_" + medFileName + if sys.platform != "win32": + tmpDir = "/tmp/" + else: + tmpDir = os.getenv('TEMP') + '/' + medFileNew = tmpDir + str(random.randint(0,1000000)) + "_" + medFileName print " -- Copy " + medFile + " to " + medFileNew - os.system("cp "+ medFile + " " + medFileNew) + + if sys.platform != "win32": + copyCommand = "cp" + else: + copyCommand = "copy /Y" + os.system(copyCommand + " " + medFile + " " + medFileNew) + medFile = medFileNew os.system("chmod 755 " + medFile) diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 9e9c57da4..30881609c 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -551,7 +551,11 @@ void SALOME_ResourcesManager::RmTmpFile() { if (_TmpFileName != "") { +#ifndef WNT string command = "rm "; +#else + string command = "del /F "; +#endif command += _TmpFileName; char *temp = strdup(command.c_str()); int lgthTemp = strlen(temp); -- 2.39.2