aboutsummaryrefslogtreecommitdiff
path: root/findutils/find.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-09 04:22:48 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-09 04:22:48 +0200
commit7fb68f199f037cb69363c8df5c934a27adc699f7 (patch)
tree2eb01a3bc4b3caf6bd7dd4fed6984716fd7ca89a /findutils/find.c
parent6774386d95cec54258f23f69bc287c99e205ebdf (diff)
downloadbusybox-w32-7fb68f199f037cb69363c8df5c934a27adc699f7.tar.gz
busybox-w32-7fb68f199f037cb69363c8df5c934a27adc699f7.tar.bz2
busybox-w32-7fb68f199f037cb69363c8df5c934a27adc699f7.zip
make it possible to keep Config/Kbuild snippets in *.c files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'findutils/find.c')
-rw-r--r--findutils/find.c175
1 files changed, 175 insertions, 0 deletions
diff --git a/findutils/find.c b/findutils/find.c
index 30fb03dd1..9022867a2 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -53,6 +53,181 @@
53 * diff -u /tmp/std_find /tmp/bb_find && echo Identical 53 * diff -u /tmp/std_find /tmp/bb_find && echo Identical
54 */ 54 */
55 55
56//kbuild:lib-$(CONFIG_FIND) += find.o
57//config:
58//config:config FIND
59//config: bool "find"
60//config: default n
61//config: help
62//config: find is used to search your system to find specified files.
63//config:
64//config:config FEATURE_FIND_PRINT0
65//config: bool "Enable -print0: NUL-terminated output"
66//config: default y
67//config: depends on FIND
68//config: help
69//config: Causes output names to be separated by a NUL character
70//config: rather than a newline. This allows names that contain
71//config: newlines and other whitespace to be more easily
72//config: interpreted by other programs.
73//config:
74//config:config FEATURE_FIND_MTIME
75//config: bool "Enable -mtime: modified time matching"
76//config: default y
77//config: depends on FIND
78//config: help
79//config: Allow searching based on the modification time of
80//config: files, in days.
81//config:
82//config:config FEATURE_FIND_MMIN
83//config: bool "Enable -mmin: modified time matching by minutes"
84//config: default y
85//config: depends on FIND
86//config: help
87//config: Allow searching based on the modification time of
88//config: files, in minutes.
89//config:
90//config:config FEATURE_FIND_PERM
91//config: bool "Enable -perm: permissions matching"
92//config: default y
93//config: depends on FIND
94//config: help
95//config: Enable searching based on file permissions.
96//config:
97//config:config FEATURE_FIND_TYPE
98//config: bool "Enable -type: file type matching (file/dir/link/...)"
99//config: default y
100//config: depends on FIND
101//config: help
102//config: Enable searching based on file type (file,
103//config: directory, socket, device, etc.).
104//config:
105//config:config FEATURE_FIND_XDEV
106//config: bool "Enable -xdev: 'stay in filesystem'"
107//config: default y
108//config: depends on FIND
109//config: help
110//config: This option allows find to restrict searches to a single filesystem.
111//config:
112//config:config FEATURE_FIND_MAXDEPTH
113//config: bool "Enable -maxdepth N"
114//config: default y
115//config: depends on FIND
116//config: help
117//config: This option enables -maxdepth N option.
118//config:
119//config:config FEATURE_FIND_NEWER
120//config: bool "Enable -newer: compare file modification times"
121//config: default y
122//config: depends on FIND
123//config: help
124//config: Support the 'find -newer' option for finding any files which have
125//config: a modified time that is more recent than the specified FILE.
126//config:
127//config:config FEATURE_FIND_INUM
128//config: bool "Enable -inum: inode number matching"
129//config: default y
130//config: depends on FIND
131//config: help
132//config: Support the 'find -inum' option for searching by inode number.
133//config:
134//config:config FEATURE_FIND_EXEC
135//config: bool "Enable -exec: execute commands"
136//config: default y
137//config: depends on FIND
138//config: help
139//config: Support the 'find -exec' option for executing commands based upon
140//config: the files matched.
141//config:
142//config:config FEATURE_FIND_USER
143//config: bool "Enable -user: username/uid matching"
144//config: default y
145//config: depends on FIND
146//config: help
147//config: Support the 'find -user' option for searching by username or uid.
148//config:
149//config:config FEATURE_FIND_GROUP
150//config: bool "Enable -group: group/gid matching"
151//config: default y
152//config: depends on FIND
153//config: help
154//config: Support the 'find -group' option for searching by group name or gid.
155//config:
156//config:config FEATURE_FIND_NOT
157//config: bool "Enable the 'not' (!) operator"
158//config: default y
159//config: depends on FIND
160//config: help
161//config: Support the '!' operator to invert the test results.
162//config: If 'Enable full-blown desktop' is enabled, then will also support
163//config: the non-POSIX notation '-not'.
164//config:
165//config:config FEATURE_FIND_DEPTH
166//config: bool "Enable -depth"
167//config: default y
168//config: depends on FIND
169//config: help
170//config: Process each directory's contents before the directory itself.
171//config:
172//config:config FEATURE_FIND_PAREN
173//config: bool "Enable parens in options"
174//config: default y
175//config: depends on FIND
176//config: help
177//config: Enable usage of parens '(' to specify logical order of arguments.
178//config:
179//config:config FEATURE_FIND_SIZE
180//config: bool "Enable -size: file size matching"
181//config: default y
182//config: depends on FIND
183//config: help
184//config: Support the 'find -size' option for searching by file size.
185//config:
186//config:config FEATURE_FIND_PRUNE
187//config: bool "Enable -prune: exclude subdirectories"
188//config: default y
189//config: depends on FIND
190//config: help
191//config: If the file is a directory, dont descend into it. Useful for
192//config: exclusion .svn and CVS directories.
193//config:
194//config:config FEATURE_FIND_DELETE
195//config: bool "Enable -delete: delete files/dirs"
196//config: default n
197//config: depends on FIND && FEATURE_FIND_DEPTH
198//config: help
199//config: Support the 'find -delete' option for deleting files and directories.
200//config: WARNING: This option can do much harm if used wrong. Busybox will not
201//config: try to protect the user from doing stupid things. Use with care.
202//config:
203//config:config FEATURE_FIND_PATH
204//config: bool "Enable -path: match pathname with shell pattern"
205//config: default y
206//config: depends on FIND
207//config: help
208//config: The -path option matches whole pathname instead of just filename.
209//config:
210//config:config FEATURE_FIND_REGEX
211//config: bool "Enable -regex: match pathname with regex"
212//config: default y
213//config: depends on FIND
214//config: help
215//config: The -regex option matches whole pathname against regular expression.
216//config:
217//config:config FEATURE_FIND_CONTEXT
218//config: bool "Enable -context: security context matching"
219//config: default n
220//config: depends on FIND && SELINUX
221//config: help
222//config: Support the 'find -context' option for matching security context.
223//config:
224//config:config FEATURE_FIND_LINKS
225//config: bool "Enable -links: link count matching"
226//config: default n
227//config: depends on FIND
228//config: help
229//config: Support the 'find -links' option for matching number of links.
230
56#include <fnmatch.h> 231#include <fnmatch.h>
57#include "libbb.h" 232#include "libbb.h"
58#if ENABLE_FEATURE_FIND_REGEX 233#if ENABLE_FEATURE_FIND_REGEX