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
pgpQ1SiTfm_9P.pgp
Description: PGP signature
