Eric Blake <[EMAIL PROTECTED]> writes: > I read that as rename() sees that "a" is a directory, so it resolves > "b/" as "b/." to ensure that b/ is not the pathname of a > non-directory (it isn't, since "b/." does not exist), then can go > ahead
No, because POSIX requires that "Write access permission is required for the directory containing 'old' and the directory containing 'new'." Here 'new' is "b/", which is equivalent to "b/.". So the directory containing 'new' is "b". But "b" does not exist, so 'rename' can't have write access to it. As far as changing 'mv' goes, I see two competing goals here: A. Have 'mv' conform to POSIX even if 'rename' does not. B. Have 'mv' do whatever 'rename' does, even if 'rename' does not conform to POSIX. We should pick either (A) or (B). We can't do both at the same time. We shouldn't do (A) for non-directories and (B) for directories (which seems to be what's being proposed here). I'd be happy to help with either (A) or (B). Personally I have a mild preference for (B) since it's easier to implement (and it lets us blame the kernel guys if some POSIX pedant bugs us :-). _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils