This is the mail archive of the
mailing list for the Cygwin project.
BUG: Severe or critical - deletes existing files and leaves nothing. (cp)
- From: "Linda Walsh , <cygwin at tlinx dot org>" <coreutils at tlinx dot org>
- To: bug-coreutils at gnu dot org
- Cc: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Mon, 09 Jan 2012 13:19:43 -0800
- Subject: BUG: Severe or critical - deletes existing files and leaves nothing. (cp)
I was trying to copy a font dir from a unix to a windows machine.
Problem is there are duplicates -- where only the case differs...
On unix, I've run a 'dedup' in my font dir, that joined any files that were the
same so they are hard links to each other. (made sense at the time... ;-) ).
windows treats different cased file names as the same.
Along comes cp, on cygwin, .. but I don't think this is a cygwin bug, as
it's doing what it is supposed to do.. it is cp that is problematic.
Note, in the below, I an alias for cp is in effect:
alias cp='cp --preserve=mode,timestamps'
i.e. by default, I try to preserve 'simple'-permissions, and timestamps.
First I tried:
/usr/share/fonts> cp -avu //bliss/usr_share/fonts/. .
removed `././Adobe (afm) fonts/Symbol.afm'
cp: cannot create hard link `././Adobe (afm) fonts/Symbol.afm' to `././Adobe
(afm) fonts/symbol.afm': No such file or directory
removed `././Adobe (afm) fonts/cmr10.afm'
cp: cannot create hard link `././Adobe (afm) fonts/cmr10.afm' to `././Adobe
(afm) fonts/CMR10.afm': No such file or directory
removed `././Adobe (afm) fonts/cmex10.afm'
(and many more... )
It removes an existing file 'Symbol', because because it sees that 'Symbol' is not
a hard link to 'symbol'; I specified "-a" to make an exact copy, so it's trying
to copy links.
But by removing 'Symbol', it removes 'symbol' and THEN can't link to it...
thus 'symbol' is gone from the local dir.
ok, at this point, I would consider it 'my bad, for using cp on windows (it used
to work without these issues, not sure what has changed)...
Then I tried the less strict:
cp -rvu /usr/share/fonts> cp -rvu //bliss/usr_share/fonts/. .
figuring without the "-a" it wouldn't try to force linking, thus no prob... ...
cp: cannot create hard link `././OTF/AJensonPro-Bold.otf' to
`././OTF/ajensonpro-bold.otf': No such file or directory
cp: cannot create hard link `././OTF/AJensonPro-BoldCapt.otf' to
`././OTF/ajensonpro-boldcapt.otf': No such file or directory
?!!?! Why is it trying to create hard links again? I didn't specify preserve
(i.e. this is a cp BUG...)
Well if I could just get it to copy them and not try to link them... so it
copies them twice..
at least they get here...
so I try the only thing that might not remove files "n":
cp -nrvu //bliss/usr_share/fonts/. .
removed `././Adobe (afm) fonts/cmbx5.afm'
cp: cannot create hard link `././Adobe (afm) fonts/cmbx5.afm' to `././Adobe
(afm) fonts/CMBX5.afm': No such file or directory
removed `././Adobe (afm) fonts/cmbx7.afm'
cp: cannot create hard link `././Adobe (afm) fonts/cmbx7.afm' to `././Adobe
(afm) fonts/CMBX7.afm': No such file or directory
removed `././Adobe (afm) fonts/cmmi10.afm'
my poor cumberland fonts... so sad!
um.... hey, if it shouldn't have removed them on -rvu, it doubly shouldn't have
done so on
when I told it "-n" (--no-clobber) don't clobber existing files...
cygcheck -f /bin/cp
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple