Home | History | Annotate | Download | only in find
History log of /src/usr.bin/find/find.h
RevisionDateAuthorComments
 1.28  22-Jan-2022  christos Use /dev/tty for SIGINFO
Fix some size_t<->int
 1.27  18-Mar-2021  cheusov find: use POSIX type uint32_t instead of u_int32_t
 1.26  13-Jun-2016  pgoyette Add new primaries -asince, -csince, and -since to compare file's
attributes against a user-specified timestamp (rather than the
attributes of a reference file).

Update the parse routines so they have access to the name of the
option being parsed. This enables accurate error reporting for
"aliases" of primaries.

Now that aliases work, introduce some aliases for consistency with
Gnu findutils.
 1.25  04-May-2013  uebayasi find(1): Compare timestamp in nsec scale in -anewer/-cnewer/-newer.
 1.24  06-Feb-2007  elad branches: 1.24.34; 1.24.40;
Add -delete from FreeBSD.
 1.23  11-Oct-2006  apb De-__P(), remove trailing spaces, sprinkle a few const, WARNS=4.
 1.22  07-Oct-2006  apb Add support for "find ... -exec ... {} +".

The code is from John Hawkinson in PR 20470. I adapted it to current,
and made some KNF and comment changes.
 1.21  20-Feb-2006  jschauma Add a new primary '-exit n':
This primary causes find to stop traversing the filesystem and
exit immediately if a previous condition was met. If no value is
specified, the exit value will be 0, else n. Note that other
primaries will be evaluated and acted upon before exiting.

Ok matt@, garbled@.
 1.20  09-Nov-2005  reed Add -false switch. From man page:

-false This primary always evaluates to false. This can be used follow-
ing a primary that caused the expression to be true to make the
expression to be false. This can be useful after using a -fprint
primary so it can continue to the next expression (using an -or
operator, for example).

This was brought up on the tech-userlevel list in October.

Using -fprint on findutils or new NetBSD find(1) does not do what
I wanted. For example, if saving results of all files that start
with a vowel or saving results of all files owned by group operator,
then the list of files owned by group operator would not include
the files starting with a vowel.

findutils's find has a workaround for this with -false and also a
"," comma opeator. (I made add this comma operator later; you can use
the comma to perform multiple independent tests.)
 1.19  12-Oct-2005  reed This adds -fprint function. The primary name "-fprint" (but not the
code) comes from findutils; it behaves the same.

From my manpage addition:

-fprint filename
This primary always evaluates to true. This creates filename or
overwrites the file if it already exists. The file is created at
startup. It writes the pathname of the current file to this
file, followed by a newline character. The file will be empty if
no files are matched.

Here is an example usage:

find /etc \( -name "*pass*" -fprint file1 \) -o \( -group operator -fprint file2 \) -o -name "w*"

Note that this example will NOT include entry in file2 if it is
matched in first expression. (This also is same behaviour as
findutils, and I have implemented a -false primary to handle that.
I will commit it later.)

This creates the file as command line argument parsing time.
If there is an error somewhere on that line, such as missing values
or mismatched parenthesis, then a file may still be created.
(Even if a later -fprint filename is unwritable.) This is similar
behaviour to findutils. (It has been suggested that this find could
be code to create the files in an extra stage after the command-line
argument parsing and before the actual function processing.)

I will add -fprintx and -fprint0 soon.

This was discussed on tech-userlevel.
 1.18  07-Aug-2003  agc branches: 1.18.4;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.17  03-Aug-2003  provos Implement -iname for case insensitive matching on file names.
From freebsd/openbsd. Approved by jaromir@, manu@, perry@.
 1.16  23-Feb-2003  jhawk delint: trailing commas in enum definitions are prohibitted
knf: instantiate macros with #define<TAB>, not <SPACE>, and also align.
 1.15  27-Sep-2002  provos support for -empty, -execdir, -mindepth, -maxdepth to match other UNIX-like
systems. based on work by tholo@openbsd.org. approved by perry.
 1.14  02-Dec-2001  kleink Since we've already been down that road with -cnewer, support GNU find(1)'s
-anewer as well.
 1.13  01-Dec-2001  kleink Add a "cnewer" primary which evaluates true if a file has a more recent
ctime than its argument.

From kre in PR bin/14802; originally suggested name was "updated" but
renamed due to GNU find(1) being prior art for this functionality.
 1.12  20-Jul-1999  cgd add -regex and -iregex primaries which, like GNU find's primaries of the
same name, match files' entire paths against regular expressions.
-regex is case sensitive, -iregex is case-insensitive. Note that these
primaries are _not_ entirely compatible with the GNU find primaries,
because their BREs appear to support alternation with \| whereas our BREs
do not. Also note there are no primaries which provide extended regular
expressions matching, though if they are desired they would be trivial
to implement.
 1.11  16-Jan-1999  simonb branches: 1.11.2;
Add GNU-style -{a,c,m}min primaries.
 1.10  12-Jan-1999  lukem Add support for -printx, which quotes pathnames in an xargs friendly way.
From [bin/6790] by Eric Fischer <eric@fudge.uchicago.edu>
 1.9  03-Jan-1999  lukem Add support for "-flags [-]flags", which matches the file flags in a
similar way that "-perm [-]mode" matches the file mode.
 1.8  21-Feb-1998  christos Simplify the function calling code and warnsify.
 1.7  02-Feb-1998  mrg merge lite2, sans getvfsbyname in functions.c (waiting on libc)
 1.6  09-Jan-1997  tls RCS ID police
 1.5  30-Dec-1993  jtc Merged our bugfixes with the 4.4BSD find from uunet.
 1.4  27-Oct-1993  jtc Added -print0 (like GNU find). This will allow file names that contain
newlines to be correctly interpreted by programs that process find
output.
 1.3  01-Aug-1993  mycroft Add RCS identifiers.
 1.2  24-Mar-1993  cgd fixed fact that "rdonly" wasn't supported by -fstype, but the man
page said it was. also fixed multiple fstype checks on the same
partition
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  01-Sep-1995  jtc imported from 44lite2
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.11.2.1  20-Aug-1999  cgd pull up rev 1.12 from trunk. (cgd)
 1.18.4.2  11-Oct-2005  reed Revert changes. I accidently committed to netbsd-2.
 1.18.4.1  11-Oct-2005  reed This adds -fprint function. The primary name "-fprint" (but not the
code) comes from findutils; it behaves the same.

From my manpage addition:

-fprint filename
This primary always evaluates to true. This creates filename or
overwrites the file if it already exists. The file is created at
startup. It writes the pathname of the current file to this
file, followed by a newline character. The file will be empty if
no files are matched.

Here is an example usage:

find /etc \( -name "*pass*" -fprint file1 \) -o \( -group operator -fprint file2 \) -o -name "w*"

This was discussed on tech-userlevel.

This creates the file as command line argument parsing time.
If there is an error somewhere on that line, such as missing values
or mismatched parenthesis, then a file may still be created.
(Even if a later -fprint filename is unwritable.) This is similar
behaviour to findutils. (It has been suggested that this find could
be code to create the files in an extra stage after the command-line
argument parsing and before the actual function processing.)

I will add -fprintx and -fprint0 soon.
 1.24.40.1  23-Jun-2013  tls resync from head
 1.24.34.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")

RSS XML Feed