From 7f1033977706502776741f7ebed72f660754560e Mon Sep 17 00:00:00 2001 From: Jan Midtgaard Date: Thu, 2 Mar 2023 08:20:59 +0100 Subject: [PATCH] Fix Sys.remove on directory on Windows --- src/sys/stm_tests.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sys/stm_tests.ml b/src/sys/stm_tests.ml index b44f3b4f2..c6142269b 100644 --- a/src/sys/stm_tests.ml +++ b/src/sys/stm_tests.ml @@ -277,8 +277,9 @@ struct | Ok () -> mem_model fs complete_path && path_is_a_dir fs path && not (path_is_a_dir fs complete_path) | Error (Sys_error s) -> (s = (p complete_path) ^ ": No such file or directory" && not (mem_model fs complete_path)) || - (s = (p complete_path) ^ ": Is a directory" && path_is_a_dir fs complete_path) || - (s = (p complete_path) ^ ": Operation not permitted" && path_is_a_dir fs complete_path) || + (s = (p complete_path) ^ ": Is a directory" && path_is_a_dir fs complete_path) || (*Linux*) + (s = (p complete_path) ^ ": Operation not permitted" && path_is_a_dir fs complete_path) || (*macOS*) + (s = (p complete_path) ^ ": Permission denied" && path_is_a_dir fs complete_path) || (*Win*) (s = (p complete_path) ^ ": Not a directory" && not (path_is_a_dir fs path)) | Error _ -> false )