Salome HOME
Add the possibility to retrieve one single file.
[tools/libbatch.git] / src / Core / BatchManager.cxx
index 874680727ff568d3f02aee45c49ccdd432b674ba..f5340bc4bd7dfdaa6aa1e2fedddfcc8f3c4033d0 100644 (file)
@@ -293,6 +293,28 @@ namespace Batch {
     return ret;
   }
 
+  bool BatchManager::importWorkFile( const Job & job,
+                                     const std::string& work_file,
+                                     const std::string& directory )
+  {
+    Parametre params = job.getParametre();
+
+    // Create local result directory
+    int status = CommunicationProtocol::getInstance(SH).makeDirectory(directory, "", "");
+    if (status)
+      LOG("Directory creation failed. Status is: " << status);
+
+    bool ret = true;
+    status = _protocol.copyFile(string(params[WORKDIR]) + "/" + work_file,
+                                _hostname, _username,
+                                directory, "", "");
+    if (status) {
+      LOG("Copy command failed. Status is: " << status);
+      ret = false;
+    }
+    return ret;
+  }
+
   MpiImpl *BatchManager::FactoryMpiImpl(string mpiImpl)
   {
     if(mpiImpl == "lam")