bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mv silently does nothing for hard links


From: Paul Eggert
Subject: Re: mv silently does nothing for hard links
Date: 08 Apr 2003 13:22:17 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Jim Meyering <address@hidden> writes:

> The UNLINK_SRC-prompted unlink always happens before
> any attempt to rename, so an unlink failure should be diagnosed.

OK, sorry, I misunderstood.

However, I looked into what POSIX says about this and think that we
still have a problem here, because POSIX requires that "mv A B" must
do nothing (and must succeed) if A and B are hard links.
<http://www.opengroup.org/onlinepubs/007904975/utilities/mv.html> says
that mv "shall perform actions equivalent to the rename() function".
It also says "If this succeeds, mv shall do nothing more with the
current source_file and go on to any remaining source_files."  So mv
shouldn't do anything tricky with unlink() either before or after the
rename(), regardless of whether we're talking about regular files or
symlinks.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]