delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/06/08/12:09:28

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
In-Reply-To: <4C0E662C.7040901@redhat.com>
References: <OFF145E76E DOT EB43EC60-ON8525773C DOT 005639A6-8525773C DOT 005650D6 AT lnotes-gw DOT ent DOT nwie DOT net> <4C0E662C DOT 7040901 AT redhat DOT com>
To: cygwin AT cygwin DOT com
MIME-Version: 1.0
Subject: Re: 'cp' utility bug when <dest-name>.exe file exist.
X-KeepSent: 5A74039D:42C90D73-8525773C:00573A3F; type=4; name=$KeepSent
Message-ID: <OF5A74039D.42C90D73-ON8525773C.00573A3F-8525773C.0058B85E@lnotes-gw.ent.nwie.net>
From: RISINGP1 AT nationwide DOT com
Date: Tue, 8 Jun 2010 12:09:04 -0400
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 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.

2) If "cp" is going to fail the copy, a more instructive error message
   would be helpful.

I understand the issue with using the generic (this is NOT a bad thing)
perror().  But maybe in this case, the "cp" command could go the extra 
mile
(needed because of Microsoft), and explain the reason for this particular
failure if it is going to fail the command.  I would not recommend 
changing
perror() - what a mess (not to mention, a ton of work) that would create!

Thanks.

Phil Rising   risingp1 AT nationwide DOT com

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019