summaryrefslogtreecommitdiffstats
path: root/usr.bin/find
Commit message (Collapse)AuthorAgeFilesLines
* Revert part of the last commit, remove {g|s}etflags from the libcjoe2000-02-052-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | interface, and statically link them to the programs using them. These functions, upon reflection and discussion, are too generically named for a library interface with such specific functionality. Also the api that they use, whilst ok for private use, isn't good enough for a libc function. Additionally there were complications with the build/install-world process. It depends heavily upon xinstall, which got broken by the change in api, and caused bootstrap problems and general mayhem. There is work in progress to address future problems that may be caused by changes in install-chain tools, and better names for {g|s}etflags can be derived when some future program requires them. For now the code has been left in src/lib/libc/gen (it started off in src/bin/ls). It's important to provide library functions for manipulating file flag strings if we ever want this interface to be adopted outside of the source tree, but now isn't necessarily the right moment with 4.0-release just around the corner. Approved: jkh
* Historically file flags (schg, uschg, etc) have been converted fromjoe2000-01-272-5/+1
| | | | | | | | | | | | | | | | | string to u_long and back using two functions, flags_to_string and string_to_flags, which co-existed with 'ls'. As time has progressed more and more other tools have used these private functions to manipulate the file flags. Recently I moved these functions from /usr/src/bin/ls to libutil, but after some discussion with bde it's been decided that they really ought to go in libc. There are two already existing libc functions for manipulating file modes: setmode and getmode. In keeping with these flags_to_string has been renamed getflags and string_to_flags to setflags. The manual page could probably be improved upon ;)
* Added missing DPADD's. Removed unrequired SRCS's.joe2000-01-011-0/+1
| | | | Obtained from: bde
* Moved flags_to_string and string_to_flags into libutil. It's used injoe1999-12-301-2/+2
| | | | many places nowadays.
* Second part of bin/3648: add -flags to search for specific flags.roberto1999-12-196-4/+87
| | | | | | | | I added $FreeBSD$ whicle I was here. The patch wasn't usable anymore due to its age so I adapted it. PR: bin/3648 Submitted by: Martin Birgmeier <mbirg@austria.ds.philips.com>
* -Wall: remove unused variable, initialize variable to avoid gcc stupidity.billf1999-09-061-1/+3
|
* $Id$ -> $FreeBSD$peter1999-08-282-2/+2
|
* The -perm option takes argument [-]mode, not [-mode]kris1999-06-061-3/+6
| | | | Obtained from: NetBSD, by way of OpenBSD
* Clarify wording to indicate that the arguments to find(1) are path namesjkoshy1999-04-191-6/+6
| | | | | | | | | (and can be both files or directories). Show white space between "(", ")", "!" and their corresponding `expression' arguments as expected by the expression parser inside find(1). Prompted by: David Honig <David.Honig@idt.com> on freebsd-doc Message-Id: <199904132055.NAA09432@justinian.Eng.idt.com>
* Typo - "the -delete primary do not.." -> "the -delete primary does not.."billf1998-12-311-2/+2
| | | | | PR: docs/9255 Submitted by: Christian Weisgerber <naddy@bigeye.rhein-neckar.de>
* Return memory from setmode.imp1998-12-161-0/+1
| | | | Obtained from: OpenBSD
* Fixed style bugs in previous commit.bde1998-11-291-1/+1
|
* Fixed English in previous commit. Clarify "lexicographical order".bde1998-11-291-8/+14
| | | | | Don't format paragraphs manually (new sentences not beginning on new lines give hard-formatted line breaks).
* Fixed my English fixes.bde1998-11-292-2/+3
|
* Fixed style bugs and English in previous commit.bde1998-11-291-15/+16
|
* Fixed disorder and and usage message. Improved English.bde1998-11-291-2/+2
| | | | Broken in: previous commit
* Fixed disordering in previous commit.bde1998-11-291-1/+1
|
* Added a sort option to find(1).wosch1998-11-294-5/+37
| | | | | The sort option make it possible to build the locate database without large (usually 20-100MB) temp files.
* Calls one or more of malloc(), warn(), err(), syslog(), execlp() ordes1998-10-131-2/+2
| | | | | | | | | | | execvp() in the child branch of a vfork(). Changed to use fork() instead. Some of these (mv, find, apply, xargs) might benefit greatly from being rewritten to use vfork() properly. PR: Loosely related to bin/8252 Approved by: jkh and bde
* PR: 7522thepish1998-08-101-1/+1
| | | | | Correct bug in the inverse operator optimisation code which caused segv on ! without a following expression.
* Fixed printf format errors.bde1998-07-061-1/+1
|
* Make sure we pass the length - 1 to readlink, since it adds its ownimp1998-06-091-1/+1
| | | | | | NUL at the end of the path. Inspired by: OpenBSD's changes in this area by theo de raadt
* Add cross references for find(1), locate(1), whereis(1) and which(1).jkoshy1998-05-151-1/+3
| | | | | Submitted by: Josh Gillam <josh@quick.net> PR: docs/6642
* Removed definition of _NEW_VFSCONF. The new vfsconf interface is nowbde1998-01-201-1/+0
| | | | the default.
* A partial frontal lobotomy for find if using the NetBSD libc whichjb1998-01-103-1/+12
| | | | | | | | | doesn't know about getvfsbyname() and the vfsconf structure. This disables the -fstype option if compiled with a pre-processor that defines __NetBSD__. With the FreeBSD built pre-processor, find can only be built with the FreeBSD libc. So when running with a NetBSD kernel, FreeBSD's libc will have to return ENOSYS for things that NetBSD doesn't support. That's life in a hybrid world.
* Sort option list so that -amin works.steve1997-11-281-1/+5
| | | | | PR: 5171 Submitted by: Dmitrij Tejblum <tejblum@arc.hq.cti.ru>
* Better wording explaining that all single character optionssteve1997-10-271-1/+10
| | | | | | are extensions along with the previous list of primaries. Suggested by: bde
* Offending statement removed from STANDARDS section. From what Isteve1997-10-271-14/+1
| | | | | | | can gather from the Posix spec that I have (which is very old) all one character options are extensions to Posix. PR: docs/4701
* Add the primaries -mmin, -amin, -cmin to find, similar to the GNU find.wosch1997-10-135-3/+128
|
* Add -execdir which will execute the exec command in the dir of the fileimp1997-08-295-5/+117
| | | | | | | in question. This change and the fts changes should be merged into 2.2-stable as soon as they are vetted in -current. This should allow cleaning of files in /tmp to be reneabled. Obtained from: OpenBSD
* Eliminate a variable that is set but never used.jdp1997-05-191-5/+4
|
* Mention that "-P" is the default.jdp1997-05-191-1/+2
|
* `it's'' -> `its'' where appropriate and typo fixes in time2posix.3.eivind1997-05-191-2/+2
| | | | | | Closes PR docs/3612. Submitted by: Josh Gilliam <soil@quick.net>
* Minor typo.max1997-05-021-2/+2
| | | | | PR: 3472 Submitted by: Josh Gilliam <soil@quick.net>
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-291-1/+1
| | | | posix standard on the topic.
* Fix "-fstype local" that was broken by another bugfix in the Lite2 merge.peter1997-03-271-5/+5
| | | | Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>, PR#3076
* Merge from Lite2 - use new getvfsbyname() and related changes.peter1997-03-115-58/+59
| | | | understand whiteouts (FTS_W from fts()).
* Fix a gross bug in the ! operator optimization code. The followingjoerg1997-03-101-1/+7
| | | | | | | | kind of expressions caused a dereferencation of an uninitialized malloc area, yielding wrong expression evaluation at best, and core dumps at worst (malloc.conf -> AJ): find ... ! \( expr1 ! expr2 \) ...
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* The option "fstype" does not handle the argument "msdos" correctly.wosch1997-01-281-7/+4
| | | | | | | | This error results from changing the name for the msdos file system from "pcfs" to "msdos". Close PR #1105 submitted by: Thomas Wintergerst <thomas@lemur.nord.de>, Slaven Rezic <eserte@cs.tu-berlin.de>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* With -delete, don't complain about non-empty directories. Otherwisepeter1996-10-051-1/+1
| | | | "cd /tmp; find . -mtime +7 -delete" is excessively noisy.
* For the -delete option, emulate the behavior of "rm -f" when dealing withpeter1996-10-051-0/+7
| | | | | | user-immutable files. Requested by: ache
* Implement a -delete option to find. The code is extremely paranoid andpeter1996-10-045-2/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | goes to a fair degree of trouble to enable something like this to be safe: cd /tmp && find . -mtime +7 -delete It removes both files and directories. It does not attempt to remove immutable files (an earlier version I showed to a few people did a chflags and tried to blow away even immutable files. Too risky..) It is thought to be safe because it forces the fts(3) driven descent to only do "minimal risk" stuff. specifically, -follow is disabled, it does checking to see that it chdir'ed to the directory it thought it was going to, it will *not* pass a pathname with a '/' character in it to unlink(), so it should be totally immune to symlink tree races. If it runs into something "fishy", it bails out rather than blunder ahead.. It's better to do that if somebody is trying to compromise security rather than risk giving them an opportunity. Since the unlink()/rmdir() is being called from within the current working directory during the tree descent, there are no fork/exec overheads or races. As a side effect of this paranoia, you cannot do a "find /somewhere/dir -delete", as the last argument to rmdir() is "/somewhere/dir", and the checking won't allow it. Besides, one would use rm -rf for that case anyway. :-) Reviewed by: pst (some time ago, but I've removed the immutable file deletion code that he complained about since he last saw it)
* [HISTORY] command appeared in Version 1 AT&T UNIXwosch1996-08-291-0/+6
| | | | Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41
* Localize itache1996-08-122-3/+5
|
* Use strtoq() instead of strtol() so that large inums, and sizes can bebde1996-04-071-4/+4
| | | | | | | specified. Not fixed: specification of large uids and gids; silent truncation of unrepresentable values.
* Don't use printf() for simple strings because it is slow. Closes PR 783.wollman1995-10-161-1/+1
| | | | Submitted by: Wolfram Schneider <wosch@freebsd.first.gmd.de>
* Simpler fix to the find bug reported by Terry Lambert <terry@lambert.org>nate1995-09-121-0/+3
| | | | | | | [ Find to a file vs. to stdout ] produces different output because find does not flush stdout when doing a -print. Submitted by: Jeffrey Hsu <hsu@freefall.freebsd.org>
* Delete bogus referneces to timezone code internal header file `tzfile.h',wollman1995-08-072-7/+5
| | | | which is no longer bogusly installed in /usr/include.
OpenPOWER on IntegriCloud