[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15738: Inconsistency & bug cp -a A B doesn't reliably create 'B' as
From: |
Linda Walsh |
Subject: |
bug#15738: Inconsistency & bug cp -a A B doesn't reliably create 'B' as a copy of 'A' even w/--remove-destination |
Date: |
Sun, 27 Oct 2013 12:23:48 -0700 |
User-agent: |
Thunderbird |
with "--remove-destination", I think this a bug. W/o it, it is
inconsistent with the requirement not to use "dirname/." to refer to
contents in 'rm'.
details:
mkdir a
touch a/file
mkdir a/dir
cp -a a b #'ok'
touch a/file2
now:
cp -au a b
(or)
cp -a a b
Either form creates another complete copy of 'a' in directory 'b'.
(Note, this is historical behavior).
FWIW,
cp -a a/ b/
behaves the same way.
However,
cp -a a/. b/.
fails the 1st time, but not if 'b' is already created (by using a form
from above).
Technically, though, the above should fail, as it says
says to copy the dir-entry for '.' over the dot entry
in 'b'.
While using '.' as a shorthand for contents of a dir has been
normal, it no longer works in utils like 'rm'.
---!!!---
*More troublesome* is that:
cp -a --remove-destination a b
doesn't work, but duplicates the behaviors of the above.
If 'b' is removed *before* the copy, as is documented,
then it should be no different than the case where 'a' is
copied to a non-existent 'b'.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#15738: Inconsistency & bug cp -a A B doesn't reliably create 'B' as a copy of 'A' even w/--remove-destination,
Linda Walsh <=