X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FmodelCDMBlackBox.cpp;h=73220cc924cc93d7bc416bf848e25384c0670073;hb=327c33758d25e6ff1f90f9ab74ea219eaed934a9;hp=295a4333b2a5eb537ded5e3c8a43a27f11d38935;hpb=eed967098aa87503c59d09c8d5c0dc87485698e2;p=crea.git diff --git a/lib/creaDevManagerLib/modelCDMBlackBox.cpp b/lib/creaDevManagerLib/modelCDMBlackBox.cpp index 295a433..73220cc 100644 --- a/lib/creaDevManagerLib/modelCDMBlackBox.cpp +++ b/lib/creaDevManagerLib/modelCDMBlackBox.cpp @@ -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 + "'.");