couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [couchdb] 04/05: Add comment for couch_util:fold_files/5
Date Wed, 10 May 2017 16:03:10 GMT
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch COUCHDB-3287-pluggable-storage-engines
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 5a222038867bf1a7e912ae9666af00e4c9379279
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
AuthorDate: Wed May 10 10:39:23 2017 -0500

    Add comment for couch_util:fold_files/5
---
 src/couch/src/couch_util.erl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/couch/src/couch_util.erl b/src/couch/src/couch_util.erl
index dc2ef64..3ed3929 100644
--- a/src/couch/src/couch_util.erl
+++ b/src/couch/src/couch_util.erl
@@ -64,6 +64,13 @@ normparts([Part | RestParts], Acc) ->
     normparts(RestParts, [Part | Acc]).
 
 
+% This is implementation is similar the builtin filelib:fold_files/5
+% except that this version will run the user supplied function
+% on directories that match the regular expression as well.
+%
+% This is motivated by the case when couch_server is searching
+% for pluggable storage engines. This change allows a
+% database to be either a file or a directory.
 fold_files(Dir, RegExp, Recursive, Fun, Acc) ->
     {ok, Re} = re:compile(RegExp, [unicode]),
     fold_files1(Dir, Re, Recursive, Fun, Acc).

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <commits@couchdb.apache.org>.

Mime
View raw message