]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Bug SWP13450 : Using of 'cp' command is incorrect Before_Merging_V3_2_0_maintainance_21Sep06 LAST_STABLE_VERSION_21_09_2006_ON_3_2_0
authorouv <ouv@opencascade.com>
Mon, 18 Sep 2006 08:20:21 +0000 (08:20 +0000)
committerouv <ouv@opencascade.com>
Mon, 18 Sep 2006 08:20:21 +0000 (08:20 +0000)
src/VISU_I/VISU_Result_i.cc
src/VISU_SWIG/VISU_Example_02.py
src/VVTK/VVTK_SegmentationCursorDlg.cxx

index 69606ebbfebead98e3d1b0a2715fabd5d42b6b7d..295af7babfe9affec60b3a551384f6333e933a53 100644 (file)
@@ -1549,9 +1549,18 @@ VISU::Result_i
   MESSAGE("Result_i::~Result_i() - this = "<<this);
   if (mySourceId == eRestoredFile) {
     static QString aCommand;
+#ifndef WNT
     aCommand.sprintf("rm %s",myFileInfo.filePath().latin1());
+#else
+    aCommand.sprintf("del /F %s",myFileInfo.filePath().latin1());
+#endif
     MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
+
+#ifndef WNT
     aCommand.sprintf("rmdir --ignore-fail-on-non-empty %s",myFileInfo.dirPath().latin1());
+#else
+    aCommand.sprintf("del /F %s",myFileInfo.dirPath().latin1());
+#endif
     MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
   }
   if(myInput) delete myInput;
index a65f4e509d7897ff04380a76302d045059874ab9..0c52c6fa16c93f6bf5bc4f8131db3cd259955e02 100644 (file)
@@ -244,7 +244,12 @@ study_id = salome.myStudy._get_StudyId()
 print "OK"
 
 file_new = str+'/VISU_005_new.hdf'
-command = "mv " + file + " " + file_new
+
+if sys.platform != "win32":
+  command = "mv " + file + " " + file_new
+else:
+  command = "move /Y " + file + " " + file_new
+  
 os.system(command)
 file = file_new
 
@@ -375,5 +380,8 @@ if aRestoreRes != 1 : print "Error"
 else : print "OK"
 
 # Remove the study file
-command = "rm -r " + file
+if sys.platform != "win32":
+  command = "rm -r " + file
+else:
+  command = "del /F " + file
 os.system(command)
index 54ee38e0e6d5b52ca10cea54a64a6161440ee1d1..6191e727989a69e6344a65e43cd3269ec8a225b0 100644 (file)
@@ -99,7 +99,11 @@ namespace VISU
   RemoveFile(const QString& theFileName)
   {
     if( !theFileName.isNull() ){
+#ifndef WNT
       QString aCommand = QString( "rm -fr " ) + theFileName;
+#else:
+      QString aCommand = QString( "del /F " ) + theFileName;
+#endif
       system( aCommand.latin1() );
     }
   }