From: Maximilien Siavelis Date: Sun, 9 Feb 2020 11:55:57 +0000 (+0100) Subject: Adaptations for Windows X-Git-Tag: V2_4_3rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cb7f594cea9015e986cafdeccf43b22742bf405e;p=tools%2Flibbatch.git Adaptations for Windows Signed-off-by: Ovidiu Mircescu --- diff --git a/CMakeModules/libbatchMacros.cmake b/CMakeModules/libbatchMacros.cmake index 9ac4d2f..e23e873 100644 --- a/CMakeModules/libbatchMacros.cmake +++ b/CMakeModules/libbatchMacros.cmake @@ -60,7 +60,7 @@ MACRO(LIBBATCH_FIND_ALL_LOCAL_COMMANDS) FIND_LOCAL_COMMAND_WIN32_DEF(LIBBATCH_RM_COMMAND rm del) FIND_LOCAL_COMMAND(LIBBATCH_SH_COMMAND sh cmd.exe) FIND_LOCAL_COMMAND_WIN32_DEF(LIBBATCH_CP_COMMAND cp copy) - FIND_LOCAL_COMMAND_WIN32_DEF(LIBBATCH_MKDIR_COMMAND mkdir mkdir) + FIND_LOCAL_COMMAND_WIN32_DEF(LIBBATCH_MKDIR_COMMAND mkdir md) FIND_LOCAL_COMMAND(LIBBATCH_RSH_COMMAND rsh rsh) FIND_LOCAL_COMMAND(LIBBATCH_RCP_COMMAND rcp rcp) FIND_LOCAL_COMMAND(LIBBATCH_SSH_COMMAND ssh plink) diff --git a/src/Core/CommunicationProtocol.cxx b/src/Core/CommunicationProtocol.cxx index 0087063..aaee92b 100644 --- a/src/Core/CommunicationProtocol.cxx +++ b/src/Core/CommunicationProtocol.cxx @@ -123,17 +123,29 @@ namespace Batch { string CommunicationProtocol::getRemoveSubCommand(const string & path) const { +#ifdef WIN32 + return string("del /s ") + path; +#else return string("rm ") + path; +#endif } string CommunicationProtocol::getRemoveDirectorySubCommand(const string & path) const { +#ifdef WIN32 + return string("rd /s /q ") + path; +#else return string("rm -fR ") + path; +#endif } string CommunicationProtocol::getMakeDirectorySubCommand(const string & path) const { +#ifdef WIN32 + return string("md ") + path; +#else return string("mkdir -p ") + path; +#endif } int CommunicationProtocol::removeFile(const std::string & path,