[Top][All Lists]

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

[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.


  .''`.  Aurelien Jarno             | GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineer
 `. `'   address@hidden         | address@hidden
   `-    people.debian.org/~aurel32 | www.aurel32.net

Attachment: coreutils_cp_link_posix.patch
Description: Text document

Attachment: signature.asc
Description: Digital signature

reply via email to

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