--- ChangeLog | 5 +++++ doc/find.texi | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 5f733d3..db80680 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-10 Stepan Kasal <[email protected]> + + Backport a fix from 4.5.x. + * doc/find.texi (Cleaning Up): Move the note about -depth up. + 2008-12-23 James Youngman <[email protected]> Fix Savannah bug #25154: Failure to compile with GCC-2.95.4 diff --git a/doc/find.texi b/doc/find.texi index 937c0fd..56d3e32 100644 --- a/doc/find.texi +++ b/doc/find.texi @@ -3865,10 +3865,18 @@ when an update requires a merge: find . -name '.#*' -print0 | xargs -0r rm -f @end example -The command above works, but the following is safer: +If your @code{find} command removes directories, you may find that +you get a spurious error message when @code{find} tries to recurse +into a directory that has now been removed. Using the @samp{-depth} +option will normally resolve this problem. + +...@c What does the following sentence mean? Why is -delete safer? --kasal +...@c The command above works, but the following is safer: + +It is also possible to use the @samp{-delete} action: @example -find . -name '.#*' -depth -delete +find . -depth -name '.#*' -delete @end example @c Idea from Franc,ois Pinard. @@ -3881,11 +3889,6 @@ which shell you use). find /tmp -depth -user "$LOGNAME" -type f -delete @end example -If your @code{find} command removes directories, you may find that -you get a spurious error message when @code{find} tries to recurse -into a directory that has now been removed. Using the @samp{-depth} -option will normally resolve this problem. - @c Idea from Noah Friedman. To remove old Emacs backup and auto-save files, you can use a command like the following. It is especially important in this case to use -- 1.5.6.5
