]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
SalomeLauncher - Use the current date in the name of the default working directory.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 18 Dec 2014 09:59:54 +0000 (10:59 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 18 Dec 2014 09:59:54 +0000 (10:59 +0100)
src/Launcher/Launcher_Job.cxx

index 34c33475638518e1f3ee50d7534a254a3456d4a4..4dd6e884bc7c13d7f9edc24a75677d4d1454e24a 100644 (file)
@@ -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;
     }