Tim Waugh <[EMAIL PROTECTED]> writes:

> rm -rf a b
> mkdir a
> mv a b/
>
> fails on Linux with coreutils-5.93:
>
> mv: target `b/' is not a directory: No such file or directory
>
> In previous releases (such as 5.2.1) it has worked.  The rename() call
> is also happy with the trailing slash.
>
> Is this a regression, or an intentional change?

As I understand it, POSIX says that "mv a b/" is equivalent to
rename("a", "b/"), and that the latter should fail when the directory
"b" does not exist.  So the old mv behavior did not conform to POSIX,
and the new mv behavior does.

Admittedly it is a murky area.  One could argue that if Linux
rename("a", "b/") works (contrary to POSIX), then mv should defer to
rename and contradict POSIX as well.  For what it's worth, Solaris 10
mv and OpenBSD 3.4 mv behave the old way, so there is a
sideways-compatibility argument here as well.

(I could possibly be responsible for the change; I don't recall
offhand right now....)


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to