10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-12-22 04:13:31 +01:00

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; Unix.rename block_channel_filename_locked block_channel_filename_tmp;
Random_variable.compress_files (); Random_variable.compress_files ();
send_log "status" 0 t0 "Compressed block file"; 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 in

View File

@ -681,14 +681,15 @@ let compress_files () =
let out_channel_dir = let out_channel_dir =
let rand_num = Random.int 1000000 |> string_of_int in let rand_num = Random.int 1000000 |> string_of_int in
let tmp_dir = let tmp_dir =
Filename.concat "!Ezfio.ezfio_filename" @@ Filename.concat !Ezfio.ezfio_filename @@
Filename.concat "blocks" @@ Filename.concat "blocks" "qmc"^rand_num
Filename.concat "qmc" rand_num
in in
try try
Unix.mkdir tmp_dir 0o755; Unix.mkdir tmp_dir 0o755;
tmp_dir 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 in
let out_channel_name = let out_channel_name =