[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: OT: find command permissions: how to exclude dir?



Rick Stevens wrote:
Gordon Messmer wrote:
You need to tell find what to do with files not named .gvfs:

find /users/tburns -name .gvfs -prune -o -print

Will not work.  As soon as the non-owner of .gvfs does a stat on the
directory, the error will be spit out.  find must "stat()" any item
it finds to handle the remainder of the predicate and POP goes the
error.

If -name is the first predicate, and you prune matches, find will not need to stat() the directory entry:

[gordon herald:~/tmp/findtest]$ find . -print
.
./noread
find: `./noread': Permission denied
./read
./read/file

[gordon herald:~/tmp/findtest]$ find . -name noread -prune -o -print
.
./read
./read/file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]