diff --git a/otherlibs/stdune-unstable/fpath.ml b/otherlibs/stdune-unstable/fpath.ml index 19a65eb1f33..fa8a22330d6 100644 --- a/otherlibs/stdune-unstable/fpath.ml +++ b/otherlibs/stdune-unstable/fpath.ml @@ -93,11 +93,11 @@ let unlink_no_err t = type clear_dir_result = | Cleared - | Does_not_exist + | Directory_does_not_exist let rec clear_dir dir = match Dune_filesystem_stubs.read_directory_with_kinds dir with - | Error ENOENT -> Does_not_exist + | Error ENOENT -> Directory_does_not_exist | Error error -> raise (Unix.Unix_error @@ -116,7 +116,7 @@ let rec clear_dir dir = and rm_rf_dir path = match clear_dir path with | Cleared -> Unix.rmdir path - | Does_not_exist -> () + | Directory_does_not_exist -> () let rm_rf ?(allow_external = false) fn = if (not allow_external) && not (Filename.is_relative fn) then diff --git a/otherlibs/stdune-unstable/fpath.mli b/otherlibs/stdune-unstable/fpath.mli index fed55caf4fe..2f273fc0e22 100644 --- a/otherlibs/stdune-unstable/fpath.mli +++ b/otherlibs/stdune-unstable/fpath.mli @@ -29,9 +29,9 @@ val initial_cwd : string type clear_dir_result = | Cleared - | Does_not_exist + | Directory_does_not_exist val clear_dir : string -> clear_dir_result -(** If the directory does not exist, this function is a no-op. *) +(** If the path does not exist, this function is a no-op. *) val rm_rf : ?allow_external:bool -> string -> unit diff --git a/otherlibs/stdune-unstable/temp.ml b/otherlibs/stdune-unstable/temp.ml index 7eddbb0019d..e46cca6d9b0 100644 --- a/otherlibs/stdune-unstable/temp.ml +++ b/otherlibs/stdune-unstable/temp.ml @@ -90,9 +90,9 @@ let destroy what fn = let clear_dir dir = (match Path.clear_dir dir with | Cleared -> () - | Does_not_exist -> - (* We can end up here if nested temporary directories are cleared starting - from the outermost directory. It's OK to do nothing in this case. *) + | Directory_does_not_exist -> + (* We can end up here if the temporary directory has already been cleared, + e.g. manually by the caller of [create Dir]. *) ()); let remove_from_set ~set = set :=