From 4e29ac9d031d623b9bdb74f45ac5c14f9f2eadbd Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 8 Sep 2015 14:54:15 -0400 Subject: 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. --- bftw.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bftw.h') 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 -- cgit v1.2.3