[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: find . -delete gives an error message for the . directory entry
From:       Matthias Andree <mandree () FreeBSD ! org>
Date:       2015-09-26 14:02:06
Message-ID: 5606A55E.50607 () FreeBSD ! org
[Download RAW message or body]

Am 25.09.2015 um 17:01 schrieb Ari Sundholm:
> 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.

Yeah, that's quite normal, the utility is exposing the mandatory error
of the underlying OS kernel. - UNIX systems are required to return
EINVAL if you try to rmdir .

Try "rmdir ." directly:

Ubuntu Linux:

> $ LC_ALL=C rmdir .
> rmdir: failed to remove '.': Invalid argument

FreeBSD 10.2:

> $ env LC_ALL=C rmdir .
> rmdir: .: Invalid argument

SUSv4 does not specify -delete for the find utility.

Bottom line: findutils suppress the pilot error from view, busybox does
not. Either is permissible, depending on implementation-specific
behaviour of the nonstandard "-delete" option.

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic