bug-coreutils
[Top][All Lists]
Advanced

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

bug#20775: cp -a -u destroys files after they are copied


From: Steffen Zahn
Subject: bug#20775: cp -a -u destroys files after they are copied
Date: Tue, 09 Jun 2015 04:18:34 +0000

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

address@hidden:~ $ cd /tmp
address@hidden:/tmp $ mkdir 1 2 3
address@hidden:/tmp $ touch 1/a
address@hidden:/tmp $ ln 1/a 2/
address@hidden:/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
address@hidden:/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
address@hidden:/tmp $ cp --version
cp (GNU coreutils) 8.21
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.
address@hidden:/tmp $ ls -la 3/
total 8
drwxr-xr-x  2 sz   sz   4096 Jun  9 06:11 .
drwxrwxrwt 13 root root 4096 Jun  9 06:11 ..
address@hidden:/tmp $ uname -a
Linux gandalf 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


reply via email to

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