Salome HOME
Add remove working directory feature.
[tools/libbatch.git] / src / Core / BatchManager.cxx
index 8194c16d9c7b84287a60229def4632808fb5dd89..4645ffbb554f0ae26ca24cb9c41f9c7f4849d009 100644 (file)
@@ -315,6 +315,21 @@ namespace Batch {
     return ret;
   }
 
+  void BatchManager::clearWorkingDir( const Job & job)
+  {
+    Parametre params = job.getParametre();
+
+    string wd = params[WORKDIR];
+    if(!wd.empty() && wd != "/")
+    {
+      int status = _protocol.removeDirectory(wd, _hostname, _username);
+      if (status)
+        LOG("removeDirectory command failed. Status is: " << status);
+    }
+    else
+      LOG("removeDirectory command failed. Invalid working directory: " << wd);
+  }
+
   MpiImpl *BatchManager::FactoryMpiImpl(string mpiImpl)
   {
     if(mpiImpl == "lam")