summaryrefslogtreecommitdiffstats
path: root/bftw.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2015-09-08 14:54:15 -0400
committerTavian Barnes <tavianator@tavianator.com>2015-09-08 17:04:53 -0400
commit4e29ac9d031d623b9bdb74f45ac5c14f9f2eadbd (patch)
tree3bbbd7f40b543e14229a85e5e64b8c8f1bcc0c6d /bftw.h
parent3c04b862ff35e2c040adbdb4d17310bff1f8cb35 (diff)
downloadbfs-4e29ac9d031d623b9bdb74f45ac5c14f9f2eadbd.tar.xz
Add -depth support.
The resulting order is fairly weird, as files are still returned in breadth-first order, but directories are returned in a backwards order based on when their reference counts drop to zero. But it's good enough for -delete support.
Diffstat (limited to 'bftw.h')
-rw-r--r--bftw.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/bftw.h b/bftw.h
index a7c14d9..a368777 100644
--- a/bftw.h
+++ b/bftw.h
@@ -98,5 +98,7 @@ int bftw(const char *path, bftw_fn *fn, int nopenfd, int flags, void *ptr);
#define BFTW_STAT (1 << 0)
/** flag: Attempt to recover from encountered errors. */
#define BFTW_RECOVER (1 << 1)
+/** flag: Visit all of a directory's descendants before the directory itself. */
+#define BFTW_DEPTH (1 << 2)
#endif // BFS_BFTW_H