Skip to content

Commit 98a46b8

Browse files
committed
patch file-to-dir Permission denied error on MingW
1 parent 189f13c commit 98a46b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sys/stm_tests.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ struct
236236
(* temporary workaround for dir-to-empty-target-dir https://github.com/ocaml/ocaml/issues/12073 *)
237237
if Sys.win32 && path_is_an_empty_dir fs new_path then fs else
238238
(* temporary workaround for dir-to-file https://github.com/ocaml/ocaml/issues/12073 *)
239-
if (Sys.win32 && path_is_file fs new_path) then
240-
(match Model.separate_path new_path in
239+
if (Sys.win32 && path_is_a_file fs new_path) then
240+
(match Model.separate_path new_path with
241241
| None -> fs
242242
| Some (new_path_pref, new_name) ->
243243
let fs = remove fs new_path_pref new_name in
@@ -334,7 +334,7 @@ struct
334334
List.exists (path_is_a_file fs) (path_prefixes old_path) ||
335335
List.exists (path_is_a_file fs) (path_prefixes new_path) ||
336336
path_is_a_dir fs old_path && Model.mem fs new_path && not (path_is_a_dir fs new_path)) ||
337-
(s = "Is a directory" && path_is_a_dir fs new_path) ||
337+
((s = "Is a directory" || s = "Permission denied") && path_is_a_dir fs new_path) ||
338338
(s = "Directory not empty" &&
339339
is_true_prefix new_path old_path || (path_is_a_dir fs new_path && not (path_is_an_empty_dir fs new_path)))
340340
| Error _ -> false)

0 commit comments

Comments
 (0)