]> SALOME platform Git repositories - tools/libbatch.git/commitdiff
Salome HOME
Adaptations for Windows
authorMaximilien Siavelis <maximilien.siavelis@simulease.com>
Sun, 9 Feb 2020 11:55:57 +0000 (12:55 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Mon, 10 Feb 2020 09:09:45 +0000 (10:09 +0100)
Signed-off-by: Ovidiu Mircescu <ovidiu.mircescu@edf.fr>
CMakeModules/libbatchMacros.cmake
src/Core/CommunicationProtocol.cxx

index 9ac4d2fe1b80a5305f48014718d04e9fd7372f90..e23e873793ee454cbccbdb856381efc129ce0d30 100644 (file)
@@ -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)
index 0087063a75c2ee3d25b3708ae5993f32fa02e26e..aaee92b1c16073fb9e3e8eaef4657cc9e3cf11a8 100644 (file)
@@ -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,