From: Ovidiu Mircescu Date: Thu, 18 Dec 2014 09:59:54 +0000 (+0100) Subject: SalomeLauncher - Use the current date in the name of the default working directory. X-Git-Tag: V7_6_0a1~29^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fe6da2eca0166f42e270fa603df7e2ceab646b5a;p=modules%2Fkernel.git SalomeLauncher - Use the current date in the name of the default working directory. --- 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; }