On Mon, 25 May 2015, Craig Skinner wrote:
...
> Thanks both for -depth & -prune.
> 
> I was wondering if it was an async mount thing:

Nope, unrelated to the mount options.


> In the case of an empty directory, is the 'No such file or directory'
> message a bug, or just my usage?

It's the expected result of your usage.

Without the -depth option, find recurses into directories after evaluating 
the condition on them.  find doesn't know that the command invoked with 
-exec deleted the directory, so it still has to recurse into it unless 
told otherwise via the -prune option.

(-empty doesn't imply -prune, as you could invoke a command that creates a 
file in the target directory, in which case find would need to evaluate 
the condition on that file.)


Philip Guenther

Reply via email to