File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,7 @@ struct
309309
310310 let output table live gtable gtfxml (module FileCfg: MyCFG.FileCfg ) =
311311 let result_dir = Fpath. (v " result" ) in
312+ GobSys. rmdir_recursive_if_exists result_dir;
312313 GobSys. mkdir_or_exists result_dir;
313314 let file = FileCfg. file in
314315 let file2funs = SH. create 100 in
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ let rmdir_if_empty dirname =
2525 with Unix. Unix_error (Unix. ENOTEMPTY, _ , _ ) ->
2626 ()
2727
28- (* * Remove directory and its content, as "rm -rf" would do. *)
28+ (* * Remove directory and its content, as "rm -rf" would do.
29+ @raise Sys_error if [path] doesn't exist. *)
2930let rmdir_recursive path =
3031 let rec f path =
3132 let path_str = Fpath. to_string path in
@@ -38,6 +39,12 @@ let rmdir_recursive path =
3839 in
3940 f path
4041
42+ let rmdir_recursive_if_exists path =
43+ try
44+ rmdir_recursive path
45+ with Sys_error _ ->
46+ ()
47+
4148
4249let exe_dir = Fpath. (parent (v Sys. executable_name))
4350
You can’t perform that action at this time.
0 commit comments