X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <AANLkTil6fa2-stL9f3hd-Dg-X6FjzVKLeG56lPoI7OYp@mail.gmail.com>
References: <OFF145E76E.EB43EC60-ON8525773C.005639A6-8525773C.005650D6@lnotes-gw.ent.nwie.net>	<AANLkTil0pNuO4a9n2Ln5H3Q0cJRdQER7NlgSTg2a9EN2@mail.gmail.com>	<OFCB72527D.F8E42EE2-ON8525773C.0058E3E2-8525773C.0059F451@lnotes-gw.ent.nwie.net>	<1276042636.1651.9.camel@erebor>	<AANLkTil6fa2-stL9f3hd-Dg-X6FjzVKLeG56lPoI7OYp@mail.gmail.com>
Date: Wed, 9 Jun 2010 15:15:54 +1200
Message-ID: <AANLkTikNdkdkRb8dKLa_aLhqQfnQ3enHhRqsLfn3cvIJ@mail.gmail.com>
Subject: Re: 'cp' utility bug when <dest-name>.exe file exist.
From: David Antliff <david.antliff@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Wed, Jun 9, 2010 at 13:38, Julio Costa wrote:
> And this is where my head got reeeally spinning... can anyone, please,
> explain the reason to why this .exe magic exists, anyway?

I can't answer that, but there is a style of symlinks that use .lnk
files. Cygwin displays them without that extension, but the actual
filename is .lnk so presumably Cygwin has to do some 'lnk-magic' to
deal with that. I know it's not the same thing as exe-magic, but it
might be related because Cygwin has to hide the "reality" from the
user in order for the symlink to work.

On Wed, Jun 9, 2010 at 04:21, Corinna Vinschen wrote:
> There is.  "foo" can mean "foo". or "foo.lnk", or "foo.exe".  Cygwin is
> handling all these names as being the same file.

With symlinks I can understand this, but why match to .exe? Is it
because Cygwin allows a user to execute a .exe file without specifying
the .exe extension? That is perhaps wrong too - if I want to run
foo.exe, I should type ./foo.exe, not ./foo - but ./foo currently
works.

Then, perhaps this logic was translated into 'cp' (but not 'mv' for
some reason?) because people wanted to copy such executables around in
the same manner: "cp foo bar" rather than "cp foo.exe bar.exe" - but
this seems like merely a 'convenience' for Windows users and not a
very good one at that.

Oh well, yet another thing I suppose to add to my list of ways Windows
has set information technology back decades :-P

-- David.

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

