delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/16/10:20:36

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <004901c43b50$ed047010$78d96f83@robinson.cam.ac.uk>
From: "Max Bowsher" <maxb AT ukf DOT net>
To: "Hannu E K Nevalainen" <garbage_collector AT telia DOT com>, <cygwin AT cygwin DOT com>
References: <NGBBLLIAMFLGJEOAJCCEOENNDKAA DOT garbage_collector AT telia DOT com>
Subject: Re: cp breaking weirdly when trying to copy an executable without specifying the .exe extension
Date: Sun, 16 May 2004 15:20:20 +0100
MIME-Version: 1.0
X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/
X-Cam-AntiVirus: No virus found
X-Cam-SpamDetails: Not scanned
X-IsSubscribed: yes
Note-from-DJ: This may be spam

Hannu E K Nevalainen wrote:
>> From: Max Bowsher
>> Sent: Friday, May 14, 2004 11:38 PM
>
>> $ touch foo.exe
>> $ cp foo bar
>> cp: `foo' and `bar' are the same file
>>
>> The above error message is rather confusing.
>>
>> Is Cygwin's cp supposed to transparently permit the omission of
>> the .exe extension, or am I misremembering?
>
>  cp  and  mv  comes out of the same box (same source file) and both seems to
> have problems with this. I had a look some time ago but came to no
> conclusion, primarily due to limited time to begin with.
>
>  This has been on the list several times before, AFAIK (from reading here)
> no-one has made efforts to do anything about it.
> IIRC/Long shot/Long time no see: Seems to be some kind of interaction with
> (was it?)stat() beeing "hacked" to check for <file>.exe also, as <file> is
> scanned for. (mv using rename for moving?)

Yes, the problem is that stat("foo") will transparently stat("foo.exe"), but open("foo") then fails. 'cp' then makes an assumption
about why this might occur, and displays a nonsense error message.

I suppose the answer is to simply patch coreutils to give a better error message in this case.

Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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