[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
find patch: allow -mode as synonym for -perm
From: |
Alan Iwi |
Subject: |
find patch: allow -mode as synonym for -perm |
Date: |
Wed, 22 Mar 2006 08:27:55 +0000 (GMT) |
Here's a tiny patch to allow "-mode" as a synonym for "-perm", just because
it's such an obvious thing for people to try to call it, particularly
because several of the other options resemble the names of the
corresponding stat() elements (-uid, -gid, -mtime, -ctime, -atime).
In principle this takes away the option to use "-mode" for another purpose
in future. But I think that any other use would cause too much confusion,
so it may as well be permitted for "-perm".
Cheers,
Alan
diff -r -u findutils-4.3.0/find/find.1 findutils-4.3.0_mode/find/find.1
--- findutils-4.3.0/find/find.1 2005-12-06 08:00:30.000000000 +0000
+++ findutils-4.3.0_mode/find/find.1 2006-03-22 08:12:58.000000000 +0000
@@ -321,6 +321,10 @@
returns false unless the symbolic link is broken.
.IP "\-mmin \fIn\fR"
File's data was last modified \fIn\fR minutes ago.
+.IP "\-mode \fI[-/+]mode\fR"
+Synonym for
+.B \-perm
+(see below).
.IP "\-mtime \fIn\fR"
File's data was last modified \fIn\fR*24 hours ago.
See the comments for
diff -r -u findutils-4.3.0/find/parser.c findutils-4.3.0_mode/find/parser.c
--- findutils-4.3.0/find/parser.c 2005-12-12 07:05:27.000000000 +0000
+++ findutils-4.3.0_mode/find/parser.c 2006-03-22 08:09:22.000000000 +0000
@@ -245,6 +245,7 @@
PARSE_OPTION ("maxdepth", maxdepth), /* GNU */
PARSE_OPTION ("mindepth", mindepth), /* GNU */
PARSE_TEST ("mmin", mmin), /* GNU */
+ PARSE_TEST ("mode", perm), /* GNU */
PARSE_OPTION ("mount", xdev), /* Unix */
PARSE_TEST ("mtime", mtime),
PARSE_TEST ("name", name),
- find patch: allow -mode as synonym for -perm,
Alan Iwi <=