This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch fix-init-delete-dir
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 1addc8e624ad2db776fe47cc88f4bb53d83b5b65
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Wed May 28 16:15:19 2025 -0400

    Improve init_delete_dir
    
    `ensure_path/1` is available since OTP 25 so let's use that
    
    [1] https://www.erlang.org/doc/apps/stdlib/filelib.html#ensure_path/1
---
 src/couch/src/couch_file.erl | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/couch/src/couch_file.erl b/src/couch/src/couch_file.erl
index c1a069edd..24c910302 100644
--- a/src/couch/src/couch_file.erl
+++ b/src/couch/src/couch_file.erl
@@ -410,9 +410,7 @@ delete_dir(RootDelDir, Dir) ->
 
 init_delete_dir(RootDir) ->
     Dir = filename:join(RootDir, ".delete"),
-    % note: ensure_dir requires an actual filename companent, which is the
-    % reason for "foo".
-    filelib:ensure_dir(filename:join(Dir, "foo")),
+    filelib:ensure_path(Dir),
     spawn(fun() ->
         filelib:fold_files(
             Dir,

Reply via email to