From: Ovidiu Mircescu Date: Thu, 13 Nov 2014 14:34:19 +0000 (+0100) Subject: Fix SalomeLauncher::getJobResults when the directory is specified. X-Git-Tag: V7_6_0a1~29^2~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=46c0a8c31935dc892123c99ef0a6a7872dbfd828;p=modules%2Fkernel.git Fix SalomeLauncher::getJobResults when the directory is specified. 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. --- diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index 957c42c5a..83e007c0c 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -629,17 +629,20 @@ Launcher::Job::common_job_params() for(std::list::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); }