mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 23:49:00 +08:00
move .conf files in var/conf/
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user