[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regression: "find dir/. -type d -empty -delete" claims 'unsuccessful
From: |
Dmitry V. Levin |
Subject: |
Re: Regression: "find dir/. -type d -empty -delete" claims 'unsuccessful', breaking scripts. |
Date: |
Tue, 19 Nov 2013 04:29:45 +0400 |
On Mon, Nov 18, 2013 at 03:55:52PM -0800, Linda A. Walsh wrote:
> In coreutils 8.21-7.1.3.
>
> It has been standard to use "." in a directory to mean it's contents
> on a recursive or copy (compare cp -al src/. dst/.).
>
> However, "find dir/. -type d -empty -delete" works, but
Does it?
$ mkdir dir && strace -eunlinkat -- find dir/. -type d -empty -delete
unlinkat(AT_FDCWD, "dir/.", AT_REMOVEDIR) = -1 EINVAL (Invalid argument)
find: cannot delete 'dir/.': Invalid argument
+++ exited with 1 +++
This behaviour seems to be consistent with rmdir:
$ mkdir dir && strace -ermdir -- rmdir dir/.
rmdir("dir/.") = -1 EINVAL (Invalid argument)
rmdir: failed to remove 'dir/.': Invalid argument
+++ exited with 1 +++
--
ldv
pgplWaCY3Jpr8.pgp
Description: PGP signature