[PATCH] cp --no-derefence --link assumes a Linux kernel
From:
Aurelien Jarno
Subject:
[PATCH] cp --no-derefence --link assumes a Linux kernel
Date:
Wed, 21 Sep 2005 23:42:00 +0200
User-agent:
Mutt/1.5.10i
Hi all,
POSIX.1-2001 says that link() should dereference symlinks. The Linux
kernel does not follow POSIX, so that calling cp with --no-dereference
and --link works as expected. However on non-Linux kernel, this does not
work as expected, the symlinks being dereferenced. This is even worse
with symlinks pointing to non-existing paths, where contrary to Linux,
cp fails in such cases.
I suggest to make regular copy of the symlink in such cases, to increase
portability of shell scripts. This is the purpose of the attached patch.
Regards,
Aurelien
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian GNU/Linux developer | Electrical Engineer
`. `' address@hidden | address@hidden
`- people.debian.org/~aurel32 | www.aurel32.net