Age | Commit message (Collapse) | Author | |
---|---|---|---|
2017-03-16 | Color link targets for -ls | Tavian Barnes | |
Fixes #18. | |||
2017-02-09 | bftw: Make the nameoff of "///" point to "/" | Tavian Barnes | |
This simplifies a few things such as -name handling for ///. | |||
2017-02-09 | bftw: Add the DIR* to bftw_state | Tavian Barnes | |
Can't forget to close it that way. | |||
2017-02-08 | Add support for -x?type with multiple types | Tavian Barnes | |
This functionality is already part of GNU findutils git. | |||
2017-02-07 | bftw: Add mising closedir() to error path | Tavian Barnes | |
2017-02-06 | bftw: Plug a leak if dirqueue_push() fails | Tavian Barnes | |
If bftw_add() succeeds but dirqueue_push() fails, we need to clean up the just-added dircache_entry. Otherwise it will leak, and we'll also fail the cache->size == 0 assertion. Fix it by extracting the dircache-related parts of bftw_pop() into a new helper function bftw_gc(), and call it from bftw_pop() as well as the bftw_push() failure path. | |||
2017-02-05 | bftw: Compute nameoff correctly for the root in BFTW_DEPTH mode | Tavian Barnes | |
2017-02-05 | Implement -printf/-fprintf | Tavian Barnes | |
Based on a patch by Fangrui Song <i@maskray.me>. Closes #16. | |||
2016-12-18 | Implement -regex, -iregex, and -regextype/-E | Tavian Barnes | |
2016-12-17 | bftw: Clean up the dirqueue implementation a bit | Tavian Barnes | |
2016-12-04 | Move portability code into util.h | Tavian Barnes | |
2016-11-23 | bftw: Infer the flags in ftwbuf_stat() | Tavian Barnes | |
2016-11-21 | bftw: Make a defensive copy of the ftwbuf | Tavian Barnes | |
The callback may modify the ftwbuf, but we check it after the callback (for typeflag and statbuf). Have them mutate a copy instead. | |||
2016-11-21 | bftw: Always initialize dircache_entry::{dev,ino} | Tavian Barnes | |
If stat() fails, they won't get filled in otherwise. Then cycle detection would have read uninitialized values. | |||
2016-11-21 | bftw: Make bftw_flags more similar to fts() options. | Tavian Barnes | |
2016-11-14 | Check for readdir() errors everywhere. | Tavian Barnes | |
2016-11-13 | bftw: Keep trailing slashes on the root in BFTW_DEPTH mode. | Tavian Barnes | |
2016-11-03 | bftw: Don't fail just because we couldn't open/read a directory. | Tavian Barnes | |
With BFTW_RECOVER set, we're not supposed to fail just because a single measly directory couldn't be handled. But using state.error as scratch space made us fail in this case. The end result is that #7 resurfaced, so fix it again. | |||
2016-10-24 | Implement -ignore_readdir_race. | Tavian Barnes | |
2016-10-02 | bftw: Add support for some exotic file types, where available. | Tavian Barnes | |
2016-10-02 | bftw: Handle errors from readdir(). | Tavian Barnes | |
2016-09-10 | bftw: Fix do/to typo in a comment. | Tavian Barnes | |
2016-08-24 | bftw: Initialize typeflag to BFTW_UNKNOWN. | Tavian Barnes | |
It was totally broken on filesystems that spit out DT_UNKNOWN. | |||
2016-05-22 | dstring: Clean up the API a bit. | Tavian Barnes | |
2016-05-17 | bftw: Use realloc() to grow the dirqueue. | Tavian Barnes | |
2016-05-17 | bftw: Remove some debugging counters that were left in accidentally. | Tavian Barnes | |
2016-04-13 | dstring: Split out the dynamic string logic. | Tavian Barnes | |
2016-02-23 | bftw: Update at_flags when not following a broken symbolic link. | Tavian Barnes | |
2016-02-23 | bftw: Plug a leak when the root is not a directory. | Tavian Barnes | |
2016-02-22 | bftw: Use the currently open directory as at_fd in BFTW_CHILD mode. | Tavian Barnes | |
2016-02-21 | bftw: Use O_CLOEXEC. | Tavian Barnes | |
2016-02-21 | bftw: Don't store the terminating '\0' in dircache_entry names. | Tavian Barnes | |
2016-02-21 | bftw: Use a better cache eviction policy. | Tavian Barnes | |
Instead of simple LRU, we now evict the open entry with the lowest refcount. This reduces the average number of components passed to openat() by a significant margin, and speeds bfs up by about ~5%. | |||
2016-02-20 | bftw: Shrink the LRU before finding the parent. | Tavian Barnes | |
Otherwise we might close the found parent. | |||
2016-02-19 | bftw: Clean up dirqueue implementation a bit. | Tavian Barnes | |
2016-02-19 | bftw: Don't keep DIR*'s around. | Tavian Barnes | |
DIR*'s were being kept around so dirfd(dir) could be passed to future openat() calls. But DIR*'s are big, holding a cache of filenames etc. read by readdir(). Instead, store the raw fd and dup() it to open a DIR* with fdopendir(). This way we can call dirclose() as soon as possible, while still keeping an open fd. Ideally there would be a way to closedir() without invoking close() on the underlying fd, but this is a good approximation. Reduces memory footprint by around 64% in a large directory tree. | |||
2016-02-17 | bftw: Use a circular buffer to implement the dirqueue. | Tavian Barnes | |
2016-02-14 | Implement -mount/-xdev. | Tavian Barnes | |
2016-02-13 | Fix -name handling when the root has trailing slashes. | Tavian Barnes | |
2016-02-13 | Follow links if appropriate in predicates. | Tavian Barnes | |
2016-02-09 | Implement -L/-follow. | Tavian Barnes | |
2016-02-06 | bftw: Don't give up when following a broken symlink. | Tavian Barnes | |
2016-02-04 | Implement -P and -H. | Tavian Barnes | |
2016-02-04 | Don't use typedefs to avoid struct/enum tags. | Tavian Barnes | |
2016-01-30 | bftw: Add missing #include. | Tavian Barnes | |
2016-01-30 | bftw: Fix fd leak if fdopendir() fails. | Tavian Barnes | |
2015-09-26 | Optimize -maxdepth in -depth mode. | Tavian Barnes | |
2015-09-26 | bftw() interface improvements: | Tavian Barnes | |
- Use enums instead of ints where it makes sense - Move the file path inside struct BFTW - Expose a fd and relative path for *at() calls | |||
2015-09-08 | Add -depth support. | Tavian Barnes | |
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. | |||
2015-09-06 | Factor some code out of bftw(). | Tavian Barnes | |