Fixing small bugs

This commit is contained in:
Anthony Scemama 2019-07-23 17:39:51 +02:00
parent f7ffed3a5a
commit b0fa735311
2 changed files with 9 additions and 5 deletions

View File

@ -392,7 +392,10 @@ let run ?(daemon=true) ezfio_filename =
Unix.rename block_channel_filename_locked block_channel_filename_tmp;
Random_variable.compress_files ();
send_log "status" 0 t0 "Compressed block file";
block_channel := open_out_gen [ Open_append ] 0o660 block_channel_filename_locked
if Sys.file_exists block_channel_filename_locked then
block_channel := open_out_gen [ Open_append ] 0o660 block_channel_filename_locked
else
block_channel := open_out block_channel_filename_locked
in

View File

@ -681,14 +681,15 @@ let compress_files () =
let out_channel_dir =
let rand_num = Random.int 1000000 |> string_of_int in
let tmp_dir =
Filename.concat "!Ezfio.ezfio_filename" @@
Filename.concat "blocks" @@
Filename.concat "qmc" rand_num
Filename.concat !Ezfio.ezfio_filename @@
Filename.concat "blocks" "qmc"^rand_num
in
try
Unix.mkdir tmp_dir 0o755;
tmp_dir
with _ -> raise (Sys_error "Cannot create temp dir")
with _ ->
let message = Printf.sprintf "Cannot create temp dir %s" tmp_dir in
raise (Sys_error message)
in
let out_channel_name =