]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Replace 'cp' to 'xcopy' for Win32
authorabd <abd@opencascade.com>
Wed, 13 Sep 2006 14:01:19 +0000 (14:01 +0000)
committerabd <abd@opencascade.com>
Wed, 13 Sep 2006 14:01:19 +0000 (14:01 +0000)
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Result_i.cc

index 375287caeb53d8fcb0afee3e0530413601b35df1..34c3d37add9d93811e22aff94f0b163de7244191 100644 (file)
@@ -334,7 +334,11 @@ namespace VISU
            aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()) + aFileName;
 
            std::ostringstream aStream;
+#ifndef WNT
                        aStream<<"cp "<<aFile<<" "<<aTmpDir<<aFileName;
+#else
+      aStream<<"xcopy "<<aFile<<" "<<aTmpDir<<aFileName<<" /Y /Q ";
+#endif
            std::string aCommand = aStream.str();
 
                        QString comm = QDir::convertSeparators( QString(aCommand.c_str()) ); 
@@ -401,7 +405,11 @@ namespace VISU
          QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
                QString tmpDir = QDir::convertSeparators( QString(aTmpDir.ToCString()) );;
          static QString aCommand;
+#ifndef WNT
          aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),tmpDir.latin1(),aFileName.latin1());
+#else
+    aCommand.sprintf("xcopy %s %s%s /Y /Q",aFileInfo.filePath().latin1(),tmpDir.latin1(),aFileName.latin1());
+#endif
                
                if(system(aCommand.latin1())){
            if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Can't execute the command :"<<aCommand);
@@ -1001,7 +1009,11 @@ namespace VISU
       aFileName += aFileInfo.fileName().latin1();
       static QString aCommand;
       string aFullFileName =  aTmpDir + aFileName;
+#ifndef WNT
       aCommand.sprintf("cp %s %s",
+#else
+      aCommand.sprintf("xcopy %s %s /Y /Q",
+#endif
                       aFileInfo.filePath().latin1(),
                       aFullFileName.c_str());
       if(system(aCommand) == -1) {
index 2abc3b876941c576d581cb8d1dfca7259fe08267..343b8e9b2e74690eec084a02867288979137df59 100644 (file)
@@ -1158,7 +1158,12 @@ Create(const char* theFileName)
     if(mySourceId == eRestoredFile){
       std::string aTmpDir(SALOMEDS_Tool::GetTmpDir());
       static QString aCommand;
-      aCommand.sprintf("cp %s %s",myFileInfo.absFilePath().latin1(),aTmpDir.c_str());
+#ifndef WNT
+      aCommand.sprintf("cp %s %s",
+#else
+      aCommand.sprintf("xcopy %s %s /Y /Q",
+#endif
+            myFileInfo.absFilePath().latin1(),aTmpDir.c_str());
       if(system(aCommand) == -1){
        MESSAGE("Create - Can't execute the command :"<<aCommand);
        return NULL;