Hello, the @node Cleaning Up contains the following parahtaph: ---snip--- 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. ---snip---
This paragraph is immediately follows two examples, both using -depth and -delete. The "spurious error messages" cannot happen with those commands; I suggest to move the paragraph up, just after the first example in the node; that example does not use -delete. Moreover, the second example in the node is introduced as "safer"; I cannot see why it is safer, you should perhaps expand on that aspect. (Actually, I'd say that -delete is a dangerous feature compared to "-print0|xargs -0", because of the trap of implied -depth.) And that second example uses the -depth option in the middle of the expression; it should be moved next to the path list. Attached please find a quick first approximation of a patch.
2008-06-13 Stepan Kasal <[EMAIL PROTECTED]> * doc/find.texi (Cleaning Up): Move the note about -depth up. diff --git a/doc/find.texi b/doc/find.texi index 9b7ee99..f68d96b 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. + [EMAIL PROTECTED] What does the following sentence mean? Why is -delete safer? --kasal [EMAIL PROTECTED] 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