X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,TW_NR,TW_YG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4F0B59EF.7080204@tlinx.org> Date: Mon, 09 Jan 2012 13:19:43 -0800 From: "Linda Walsh , " User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: bug-coreutils AT gnu DOT org CC: "cygwin AT cygwin DOT com" Subject: BUG: Severe or critical - deletes existing files and leaves nothing. (cp) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/. . Got: 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... ... well... removed `././OTF/AJensonPro-Bold.otf' cp: cannot create hard link `././OTF/AJensonPro-Bold.otf' to `././OTF/ajensonpro-bold.otf': No such file or directory removed `././OTF/AJensonPro-BoldCapt.otf' cp: cannot create hard link `././OTF/AJensonPro-BoldCapt.otf' to `././OTF/ajensonpro-boldcapt.otf': No such file or directory removed `././OTF/AJensonPro-BoldDisp.otf' ------ ?!!?! Why is it trying to create hard links again? I didn't specify preserve links!?! (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/. . and... 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' ... *sigh*... 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... DOUBLE BUG!.... cygcheck -f /bin/cp coreutils-8.14-1 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple