move .conf files in var/conf/

This commit is contained in:
Pascal Brisset
2009-08-19 10:30:48 +00:00
parent a5e87b83ff
commit e7f3169d75
2 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -128,12 +128,13 @@ let xml_parse_compressed_file = fun file ->
let md5_ofs = 3*6+1
let md5_len = 32
let search_conf = fun md5 ->
let files = Sys.readdir var_path in
let dir = var_path // "conf" in
let files = Sys.readdir dir in
let rec loop = fun i ->
if i < Array.length files then begin
if String.length files.(i) > (md5_ofs + md5_len)
&& String.sub files.(i) md5_ofs md5_len = md5 then
var_path // files.(i)
dir // files.(i)
else
loop (i+1)
end else
+3 -1
View File
@@ -228,7 +228,9 @@ let () =
(** Save the configuration for future use *)
let d = U.localtime (U.gettimeofday ()) in
let filename = sprintf "%02d_%02d_%02d__%02d_%02d_%02d_%s_%s.conf" (d.U.tm_year mod 100) (d.U.tm_mon+1) (d.U.tm_mday) (d.U.tm_hour) (d.U.tm_min) (d.U.tm_sec) md5sum aircraft in
let f = open_out (Env.paparazzi_home // "var" // filename) in
let d = Env.paparazzi_home // "var" // "conf" in
mkdir d;
let f = open_out (d // filename) in
Printf.fprintf f "%s\n" (ExtXml.to_string_fmt configuration);
close_out f end;