From fe6da2eca0166f42e270fa603df7e2ceab646b5a Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Thu, 18 Dec 2014 10:59:54 +0100 Subject: [PATCH] SalomeLauncher - Use the current date in the name of the default working directory. --- src/Launcher/Launcher_Job.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index 34c334756..4dd6e884b 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -582,16 +582,17 @@ Launcher::Job::common_job_params() // We define a default directory if (_work_directory == "") { + const size_t BUFSIZE = 32; + char date[BUFSIZE]; + time_t curtime = time(NULL); + strftime(date, BUFSIZE, "%Y_%m_%d__%H_%M_%S", localtime(&curtime)); if(!_resource_definition.working_directory.empty()) { - _work_directory = _resource_definition.working_directory; + std::string job_dir = std::string("/job_") + date; + _work_directory = _resource_definition.working_directory + job_dir; } else { - const size_t BUFSIZE = 32; - char date[BUFSIZE]; - time_t curtime = time(NULL); - strftime(date, BUFSIZE, "%Y_%m_%d__%H_%M_%S", localtime(&curtime)); _work_directory = std::string("/$HOME/Batch/workdir_"); _work_directory += date; } -- 2.39.2