Package: coreutils
Version: 8.5-1
Tags: upstream
Forwarded: http://debbugs.gnu.org/6960
Hi,
I have a hard link that I want to replace with a symlink without
disturbing concurrent tasks:
echo "some data" >file
ln file link
ln -s file link.tmp
mv -f link.tmp link
I would expect that to succeed. Instead:
$ mv -f link.tmp link
mv: `link.tmp' and `link' are the same file
POSIX is somewhat unclear about this situation:
If the source_file operand and destination path name the same
existing file, then the destination path shall not be removed,
and [...]
The crux is what it means to "name the same existing file". As
explained at [1], I believe that passage is not intended to apply to a
symlink and hard link to the same file, but it's hard to be sure.
Aside from POSIX, there are other reasons to want to be able to do
this easily, but that's already well covered in the upstream report.
See http://bugs.debian.org/654596 for context.
Nothing particularly urgent about this; just filing so it doesn't get
forgotten.
Thanks for keeping coreutils working well.
Jonathan
[1] http://austingroupbugs.net/view.php?id=534
If this passage applies to cases where src is a symlink to the same
inode as dst, then a POSIX-compliant mv implementation could act as
though I had written "rm -f link.tmp" instead of "mv ...", which seems
a little insane. Hopefully the Austin group will clarify it soon.
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]