Salome HOME
Fix SalomeLauncher::getJobResults when the directory is specified.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 13 Nov 2014 14:34:19 +0000 (15:34 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 13 Nov 2014 14:34:19 +0000 (15:34 +0100)
There was a case where SalomeLauncher::getJobResults would have
copied the remote files to another directory than the one chosen
in the parameters of the function.

src/Launcher/Launcher_Job.cxx

index 957c42c5ab8fe0814b3ad427601ed01c0d014bba..83e007c0cde6b6954a97ee5680d8dc53ecaa1c51 100644 (file)
@@ -629,17 +629,20 @@ Launcher::Job::common_job_params()
   for(std::list<std::string>::iterator it = _out_files.begin(); it != _out_files.end(); it++)
   {
     std::string file = *it;
-
-    // local file 
-    size_t found = file.find_last_of("/");
-    std::string local_file = _result_directory +  "/" + file.substr(found+1);
-
     // remote file -> If file is not an absolute path, we apply _work_directory
     std::string remote_file;
+    std::string local_file;
     if (file.substr(0, 1) == std::string("/"))
+    {
       remote_file = file;
+      size_t found = file.find_last_of("/");
+      local_file = file.substr(found+1);
+    }
     else
+    {
       remote_file = _work_directory + "/" + file;
+      local_file = file;
+    }
 
     params[Batch::OUTFILE] += Batch::Couple(local_file, remote_file);
   }