10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-12-22 12:23:30 +01:00
This commit is contained in:
Anthony Scemama 2019-07-31 15:07:04 +02:00
parent b0fa735311
commit 35a083f6f3
5 changed files with 11 additions and 16 deletions

View File

@ -69,6 +69,9 @@ let dir_name = lazy(
let md5 = let md5 =
QmcMd5.hash () QmcMd5.hash ()
in in
let d = Filename.concat ezfio_filename "blocks" in
if not ( Sys.file_exists d ) then
Unix.mkdir d 0o755;
List.fold_right Filename.concat List.fold_right Filename.concat
[ ezfio_filename ; "blocks" ; md5 ; Filename.dir_sep ] "" [ ezfio_filename ; "blocks" ; md5 ; Filename.dir_sep ] ""
) )

View File

@ -10,7 +10,7 @@ let input_directory = lazy (
in in
begin begin
if not (Sys.file_exists dirname && Sys.is_directory dirname) then if not (Sys.file_exists dirname) then
Unix.mkdir dirname 0o777 Unix.mkdir dirname 0o777
end ; end ;

View File

@ -347,7 +347,7 @@ let run ?(daemon=true) ezfio_filename =
Lazy.force Block.dir_name Lazy.force Block.dir_name
in in
let () = let () =
if not ( Sys.file_exists dirname && Sys.is_directory dirname ) then if not ( Sys.file_exists dirname ) then
Unix.mkdir dirname 0o755 Unix.mkdir dirname 0o755
in in
Filename.concat dirname ( Filename.concat dirname (

View File

@ -46,18 +46,6 @@ let ezfio_filename = lazy (
in in
set_ezfio_filename full_path; set_ezfio_filename full_path;
(*
(* Check if input directory is present *)
let dirname = Filename.concat full_path "input" in
if not (Sys.file_exists dirname) then
Unix.mkdir dirname 0o755;
(* Check if blocks directory is present *)
let dirname = Filename.concat full_path "blocks" in
if not (Sys.file_exists dirname) then
Unix.mkdir dirname 0o755;
*)
!Ezfio.ezfio_filename !Ezfio.ezfio_filename
) )

View File

@ -680,9 +680,13 @@ 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 dirname =
Filename.concat !Ezfio.ezfio_filename "blocks"
in
if not ( Sys.file_exists dirname ) then
Unix.mkdir dirname 0o755;
let tmp_dir = let tmp_dir =
Filename.concat !Ezfio.ezfio_filename @@ Filename.concat dirname ("qmc"^rand_num)
Filename.concat "blocks" "qmc"^rand_num
in in
try try
Unix.mkdir tmp_dir 0o755; Unix.mkdir tmp_dir 0o755;