summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bftw.c4
-rw-r--r--bftw.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/bftw.c b/bftw.c
index 687dc03..6f97bf6 100644
--- a/bftw.c
+++ b/bftw.c
@@ -1168,7 +1168,7 @@ static int bftw_stream(const struct bftw_args *args) {
return -1;
}
- assert(!(state.flags & BFTW_SORT));
+ assert(!(state.flags & (BFTW_SORT | BFTW_BUFFER)));
bftw_batch_start(&state);
for (size_t i = 0; i < args->npaths; ++i) {
@@ -1279,7 +1279,7 @@ done:
/** Select bftw_stream() or bftw_batch() appropriately. */
static int bftw_auto(const struct bftw_args *args) {
- if (args->flags & BFTW_SORT) {
+ if (args->flags & (BFTW_SORT | BFTW_BUFFER)) {
return bftw_batch(args);
} else {
return bftw_stream(args);
diff --git a/bftw.h b/bftw.h
index 619d2a3..c458e1b 100644
--- a/bftw.h
+++ b/bftw.h
@@ -167,6 +167,8 @@ enum bftw_flags {
BFTW_PRUNE_MOUNTS = 1 << 7,
/** Sort directory entries before processing them. */
BFTW_SORT = 1 << 8,
+ /** Read each directory into memory before processing its children. */
+ BFTW_BUFFER = 1 << 9,
};
/**