Re: Bug#389170: coreutils: mv -v fails on hardlinked files
From:
Eric Blake
Subject:
Re: Bug#389170: coreutils: mv -v fails on hardlinked files
Date:
Sun, 24 Sep 2006 19:49:57 +0000
> And the result would be correct wether x is removed, or y was replaced (I
> see this similar to rm not doing the same thing as unlink to achieve removal
> of a name, but resorting to a variety of syscalls).
This corner case is problematic in POSIX. The fact that GNU even removes
x is counter to a strict reading of POSIX, which requires that mv defer
to rename(2), and that rename is a no-op when the old and new name
refer to the same file (even when it is two different names of a hard
link). But this is so counter-intuitive that GNU has chosen to break with
POSIX on this regards (except perhaps under POSIXLY_CORRECT; I'd
have to re-read the source to be sure). So I'm not sure if Jim should
spend much more effort improving the verbose output; the fact that it
is different already goes to show that hard links are a special case.
--
Eric Blake