-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Koblinger Egmont on 4/10/2006 6:28 AM: > Hi, > > Using coreutils 5.94, the command > rmdir -p foo/bar/nonexistent > does not remove the `foo' or `foo/bar' empty directories if the mentioned > subdirectory (foo/bar/nonexistent) does not exist.
The POSIX wording is a bit ambiguous here (http://www.opengroup.org/onlinepubs/009695399/utilities/rmdir.html). It states simply that when -p is in effect, "Remove all directories in a pathname. For each dir operand: 1. The directory entry it names shall be removed. 2. If the dir operand includes more than one pathname component, effects equivalent to the following command shall occur: rmdir -p $(dirname dir)" One reading is that since step 1 fails, the entire rmdir command fails at that point without attempting step 2. But I think your request is valid - foo/bar/nonexistent is certainly removed (since it never existed), then it looks like we can read POSIX as requiring that the command should continue on to remove foo/bar and foo. The only question now is what do other implementations (such as BSD or Solaris) do in this case? - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEOlYz84KuGfSFAYARAhOhAJ98uOySh1bP+Aiw8hD03Ba1PFogKQCeKAq4 tFn8TA/OI0TVDuFMZGMui80= =8SkT -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
