X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Tue, 8 Jun 2010 18:21:23 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: 'cp' utility bug when .exe file exist. Message-ID: <20100608162123.GT8163@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4C0E662C DOT 7040901 AT redhat DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Jun 8 12:09, RISINGP1 AT nationwide DOT com wrote: > >On 06/08/2010 09:42 AM, RISINGP1 AT nationwide DOT com wrote: > >> As to the "cp" issue, while IMHO, it should go ahead and do the copy, > >> a more instructive error message would be helpful: > >> > >> cp: cannot create regular file `my': File 'my.exe' exists > > > >Huh? Do the copy, then give a failure message? No. A failure message > >should only occur if the copy failed. > > > >Did you mean "continue to fail, but make the failure message more > >friendly?" If so: > >Patches to coreutils welcome. But be aware that this error message uses > >the equivalent of perror(), where EEXIST would not have quite that > >wording. In other words, such a patch would be pretty invasive, to > >recognize the exact errno value that cygwin1.dll returns in this > >particular failure-to-create case, then massaging just that error case > >into your desired message, so I probably won't be writing the patch any > >time soon (I've got higher-priority things on my plate at the moment). > > > >Or did you mean "change it to succeed, in spite of the naming conflict", > >in which case there is no failure message and nothing to patch in > coreutils. > > > >-- > >Eric Blake eblake AT redhat DOT com +1-801-349-2682 > >Libvirt virtualization library http://libvirt.org > > > > Eric - > > Sorry for the confusion. I understand how it arose. > > What I meant: > > 1) IMHO, "cp" should do the copy. Also, IMHO, there is no naming > conflict; > "foo" and "foo.exe" are not the same name. (I come from a long UNIX > background.) No error message should be issued. There is. "foo" can mean "foo". or "foo.lnk", or "foo.exe". Cygwin is handling all these names as being the same file. If you stat("foo") Cygwin will return data for "foo.exe" if it exists. If you try to start an executable "foo", and only "foo.exe" exists, you want to start "foo.exe" rather than getting a "file not found" message, I assume. Along the same lines a file "foo" would hide the file "foo.exe" and there would be no way for you to access it as "foo". That's not desired. Therefore, the transparency of handling "foo", "foo.exe" and "foo.lnk" as the same file comes with a price. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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