find . -delete gives an error message for the . directory entry

Denys Vlasenko vda.linux at googlemail.com
Wed Oct 7 19:02:56 UTC 2015


On Fri, Sep 25, 2015 at 5:01 PM, Ari Sundholm <ari at tuxera.com> wrote:
> Hello!
>
> Busybox (git HEAD) seems to give an error when doing a "find . -delete"
> within a directory:
>
> ------------------>8-------------------------------------------------
> ~/busybox/foobarbaz$ ls
> ~/busybox/foobarbaz$ find
> .
> ~/busybox/foobarbaz$ find . -delete
> ~/busybox/foobarbaz$ echo $?
> 0
> ~/busybox/foobarbaz$ ../busybox find . -delete
> find: .: Invalid argument
> ~/busybox/foobarbaz$ echo $?
> 0
> ------------------>8-------------------------------------------------
>
> This error is not given by the findutils version, as shown above.
> Strangely enough, the error is not reflected in the return value. This
> happens also when the directory is non-empty.

Fixed in git - now rmdir(".") will be silently skipped.


More information about the busybox mailing list