From ee84c4eb81302f3727cab4773f5ce10c99210cf7 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 2 Oct 2012 05:45:20 +0000
Subject: [PATCH] don't save onelab db with ':' characters: Windows does not
 allow it

---
 Fltk/onelabWindow.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp
index cabb26e05b..2835ba2a34 100644
--- a/Fltk/onelabWindow.cpp
+++ b/Fltk/onelabWindow.cpp
@@ -388,10 +388,20 @@ static void saveDb(const std::string &fileName, bool withTimeStamp=false)
     time(&now);
     tm *t = localtime(&now);
     char stamp[32];
-    sprintf(stamp, "_%04d-%02d-%02d-%02d:%02d:%02d", 1900 + t->tm_year,
+    sprintf(stamp, "_%04d-%02d-%02d_%02d-%02d-%02d", 1900 + t->tm_year,
             1 + t->tm_mon, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
     std::vector<std::string> split = SplitFileName(fileName);
     name = split[0] + split[1] + stamp + split[2];
+
+    // FIXME:
+    // modifiy all the "client/9Output files" onelab variables to include the
+    // stamp and rename the files on disk using the new name
+    //       iterate over all OutputFiles
+    //       SplitFileName
+    //       change name in onelab db
+    //       rename(old, new); on disk (in stdio.h)
+    // need to detect if a file is already stamped. We could simply check the
+    // sequence of _ - - - _ - - - . characters for this.
   }
 
   Msg::StatusBar(2, true, "Saving database '%s'...", name.c_str());
-- 
GitLab