]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/modelCDMBlackBox.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / modelCDMBlackBox.cpp
index 295a4333b2a5eb537ded5e3c8a43a27f11d38935..73220cc924cc93d7bc416bf848e25384c0670073 100644 (file)
@@ -172,7 +172,12 @@ bool modelCDMBlackBox::SetAuthors(const std::string& authors, std::string*& resu
   in.close();
   out.close();
   //delete old file and rename new file
+#ifdef _WIN32
+  std::string renameCommand = "move /Y \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#else
   std::string renameCommand = "mv \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#endif
+  
   if(system(renameCommand.c_str()))
     {
       result = new std::string("An error occurred while running '" + renameCommand + "'.");
@@ -232,7 +237,12 @@ bool modelCDMBlackBox::SetCategories(
   in.close();
   out.close();
   //delete old file and rename new file
+#ifdef _WIN32
+  std::string renameCommand = "move /Y \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#else
   std::string renameCommand = "mv \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#endif
+  
   if(system(renameCommand.c_str()))
     {
       result = new std::string("An error occurred while running '" + renameCommand + "'.");
@@ -291,7 +301,11 @@ bool modelCDMBlackBox::SetDescription(
   in.close();
   out.close();
   //delete old file and rename new file
+#ifdef _WIN32
+  std::string renameCommand = "move /Y \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#else
   std::string renameCommand = "mv \"" + pathHeader + ".tmp\" \"" + pathHeader + "\"";
+#endif
   if(system(renameCommand.c_str()))
     {
       result = new std::string("An error occurred while running '" + renameCommand + "'.");