GNU bug report logs - #20775
cp: improve hardlink dups handling with "cp -a -u"

Previous Next

Package: coreutils;

Reported by: Steffen Zahn <steffzahn <at> gmail.com>

Date: Tue, 9 Jun 2015 04:35:03 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: "L. A. Walsh" <coreutils <at> tlinx.org>
To: Steffen Zahn <steffzahn <at> gmail.com>, 20775 <at> debbugs.gnu.org, 10471 <at> debbugs.gnu.org
Subject: bug#20775: cp -a -u destroys files after they are copied
Date: Tue, 30 Jun 2015 00:02:51 -0700
I think you'll find this was reported 3 years ago..

    "bug#10471: Severe or critical - deletes existing files and leaves 
nothing. (cp)"
https://lists.gnu.org/archive/html/bug-coreutils/2015-04/msg00001.html

Unfortunately it was closed it out w/the reason that  it was a 
"cygwin/windows-only"
-- which I disagreed with.  I was told the cygwin dev would check it out and
if it was in coreutils would move it back to active status (that was 3+ 
years ago).

On 6/8/2015 9:18 PM, Steffen Zahn wrote:
> Hello,
>
> I found that the cp command acts "sub-optimal" when copying 
> hard-linked files of the same name from several directories to one 
> target directory, it first copies the files then removes them. I 
> cannot see how that can be the intended behaviour. Please fix this.
>
> best regards
>      Steffen Zahn
>
> sz <at> gandalf:~ $ cd /tmp
> sz <at> gandalf:/tmp $ mkdir 1 2 3
> sz <at> gandalf:/tmp $ touch 1/a
> sz <at> gandalf:/tmp $ ln 1/a 2/
> sz <at> gandalf:/tmp $ ls -li 1 2
> 1:
> total 0
> 262424 -rw-r--r-- 2 sz sz 0 Jun  9 06:10 a
>
> 2:
> total 0
> 262424 -rw-r--r-- 2 sz sz 0 Jun  9 06:10 a
> sz <at> gandalf:/tmp $ cp -a -u --verbose 1/* 2/* 3/
> '1/a' -> '3/a'
> removed '3/a'
> cp: cannot create hard link '3/a' to '3/a': No such file or directory
> sz <at> gandalf:/tmp $ cp --version
>





This bug report was last modified 6 years and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.