You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/05/10 16:03:10 UTC

[couchdb] 04/05: Add comment for couch_util:fold_files/5

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 <pa...@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" <co...@couchdb.apache.org>.