>
> Note that the underlying rename would fail on Linux 2.6.x and *BSD
> (but it'd succeed on Solaris 9 and 10):
>
> $ touch a; rm -rf b; perl -e 'rename "a", "b/" or die "$!"'
The difference is whether a is a directory or a regular file.
When a is not a directory, I would expect rename("a", "b/")
to fail because it would attempt to create a directory (although
that may be a defect in POSIX for not explicitly mentioning this
case). But when a is a directory, I see no reason why rename
cannot succeed.
> Not a directory at -e line 1.
> [Exit 20]
>
> Currently, mv detects this particular `problem' without performing
> an actual rename, so it's more consistent than it would be if it
> were relying on the actual system call.
>
Which problem, the issue of moving a non-directory into
something that looks like a directory because of the
trailing slash, or the issue of moving a directory to another
looks-like-a-directory?
--
Eric Blake