| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a significant optimization for conditions that need these
tables:
Benchmark #1: ./bfs ~/code/linux -nouser >/dev/null
Time (mean ± σ): 232.0 ms ± 2.5 ms [User: 44.3 ms, System: 185.0 ms]
Range (min … max): 228.7 ms … 238.7 ms 12 runs
Benchmark #2: ./bfs-1.6 ~/code/linux -nouser >/dev/null
Time (mean ± σ): 1.050 s ± 0.012 s [User: 544.2 ms, System: 500.0 ms]
Range (min … max): 1.025 s … 1.063 s 10 runs
Benchmark #3: find ~/code/linux -nouser >/dev/null
Time (mean ± σ): 1.040 s ± 0.012 s [User: 533.6 ms, System: 500.6 ms]
Range (min … max): 1.017 s … 1.054 s 10 runs
Summary
'./bfs ~/code/linux -nouser >/dev/null' ran
4.48 ± 0.07 times faster than 'find ~/code/linux -nouser >/dev/null'
4.52 ± 0.07 times faster than './bfs-1.6 ~/code/linux -nouser >/dev/null'
|
|
|
|
|
|
| |
Similar to 9009456c, those functions may open /etc/{passwd,group}, so
they need an FD available. Right now, -ls on large trees eventually
starts printing numeric IDs instead of usernames/group names.
|
| |
|
| |
|
|
|
|
|
| |
mktime() returns -1 on error, but also for one second before the epoch.
Compare the input against localtime(-1) to distinguish those cases.
|
| |
|
|
|
|
|
| |
This is required by POSIX to ensure the mktime() determines itself
whether DST is in effect.
|
|
|
|
|
| |
FreeBSD has a function timezone() that conflicts with the global
variable, despite that being specified by POSIX. Use tm_gmtoff instead.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The new POSIX version with -mount isn't out yet, so there's no point in
conforming to a non-existent document while breaking compatibility with
GNU find, which hasn't changed yet either. But a warning is added for
the future incompatibility. This patch can be reverted to re-enable the
feature.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
POSIX now says -mount should skip the whole mount point, while -xdev
should only skip its descendents.
C.f. http://austingroupbugs.net/view.php?id=1133
C.f. https://savannah.gnu.org/bugs/?42318
C.f. https://savannah.gnu.org/bugs/?54745
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This makes `bfs a b` treat `a` and `b` as siblings.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Since we're going to want to abstract more things that aren't part of
POSIX.1e (like xattrs) in a similar way, let's give this a more generic
name. And while we're at it, give it some more precise error reporting,
and add some tests.
|
|
|
|
| |
We can just use bfs_stat() with a NULL at_path.
|
| |
|
|
|
|
| |
C.f. https://no-color.org/
|
|
|
|
| |
Previously we weren't re-ordering -type in front of -newerXY
|
|
|
|
| |
GNU find does too.
|
| |
|
|
|
|
| |
Fewer casts needed this way.
|
|
|
|
|
|
| |
C.f. https://savannah.gnu.org/bugs/?54913
C.f. https://lkml.org/lkml/2019/2/11/2027
Fixes https://github.com/tavianator/bfs/issues/37
|
| |
|
|
|
|
| |
Closes #48
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
I'm not sure people care very much whether the functionality they're
looking up originated in POSIX/BSD/GNU find (and if they do, they can
check those docs).
|
|
|
|
|
|
| |
This is consistent with BSD find, not with GNU find. But the GNU find
feature was an (incorrect) attempt to be compatible with BSD find
anyway.
|
|
|
|
| |
FreeBSD find supports this.
|
|
|
|
|
|
|
|
|
|
| |
The proper way to check for nonexistent users/groups is to set errno to
0 before the get{grg,pwu}id() call, and check it afterwards.
On doing this, it becomes obvious that the call can fail if bftw() is
using all the available FDs, so give them some ephemeral FDs. It would
be ideal to read the user/group table only once, but this fixes the bug
for now.
|
|
|
|
| |
bfs has had a comprehensive help text and man page for a while now.
|
| |
|
|
|
|
|
|
|
|
| |
The file is there by default, but deprecated and not a POSIX.1E
implementation. While I'm at it, move the logic to posix1e.h so other
files aren't burdened with an extra include.
Fixes the other half of #40.
|
|
|
|
|
|
| |
%{cc} is now ${cc} to avoid warnings about an unrecognized format
specifier, and %P and %L are now %pP and %pL to make them look more like
standard format strings.
|