[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'cp -lL' behaviour conflicts with documentation
From: |
Paul Eggert |
Subject: |
Re: 'cp -lL' behaviour conflicts with documentation |
Date: |
Wed, 16 Mar 2005 00:53:07 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
Eric Blake <address@hidden> writes:
> $ touch a
> $ ln -s a b
> $ ln b c # Bug: c should be a hard link to a, not b
> $ ls -l a b c
> -rw-r--r-- 1 eblake None 0 Mar 15 19:04 a
> lrwxrwxrwx 2 eblake None 1 Mar 15 19:04 b -> a
> lrwxrwxrwx 2 eblake None 1 Mar 15 19:04 c -> a
I agree that this is an incompatibility with POSIX, and should get
fixed one way or another.
Solaris 9 /usr/xpg4/bin/ln and OpenBSD 3.4 /bin/ln agree with POSIX,
but Solaris 9 /bin/ln agrees with GNU ln. So there is a practical
compatibility issue here.
Also, Solaris 9 /usr/xpg4/bin/ln and OpenBSD 3.4 /bin/ln don't agree
about whether "ln b c" should dereference b just once (which is what
Solaris does) or repeatedly until it finds a non-symlink (which is
what OpenBSD 3.4 ln does, because that's what OpenBSD link() does).
It does seem to be a messy area. It's not clear to me that POSIX was
intended to specify what it does. Personally I prefer the GNU "ln"
behavior, on hosts that support hard links to symlinks: it's much
cleaner and easier to explain.
Maybe this should be brought before the POSIX committee?