-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Juergen Reuter on 8/24/2007 7:47 AM: > rmdir -p dir2/../dir1 > > (which after expansion denotes the same directory) then you get the > error message "dir2/..: Directory not empty", probably since ".." is > handled like an ordinary directory segment specifier.
Ahh, but dir1 WAS deleted, as requested. It was only when rmdir moved on to the next section, "dir2/..", that a failure was detected. > I wonder, if rmdir should remove by file path expansion all occurrences > of ".." and "." from the path before taking any further action. This > would avoid the above annoying behavior. Or does the Posix standard > demand the current behavior? Thanks for the report. You are correct that POSIX requires the behavior: http://www.opengroup.org/onlinepubs/009695399/utilities/rmdir.html However, GNU rm also provides the --ignore-fail-on-non-empty option, which silences the message that you found annoying. And if you want to rely only on standardized features, then this idiom works pretty well in makefiles when $(directory) might contain ..: rmdir -p $(directory) 2>/dev/null || : - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGzufY84KuGfSFAYARAgWCAJ9ttJkMTHKmnt9ZRCdvj6ow8anWKQCfRMKh 3aOxq9b1sZS4NEiFyd6nClM= =o/Y1 -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils