delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/12/11:24:04

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 12 Mar 2010 17:23:48 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: the .exe extension
Message-ID: <20100312162348.GQ6505@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <2BF01EB27B56CC478AD6E5A0A28931F2C1E28C AT A1DAL1SWPES19MB DOT ams DOT acs-inc DOT net> <4B9A5ADA DOT 2030708 AT redhat DOT com> <4B9A6291 DOT 90108 AT towo DOT net>
MIME-Version: 1.0
In-Reply-To: <4B9A6291.90108@towo.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
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 Mar 12 16:49, Thomas Wolff wrote:
> On 12.03.2010 16:16, Eric Blake wrote:
> >>...
> >This is an area of active conversation; if you would like, you can test
> >the latest snapshot and the experimental coreutils 8.4-1 to see if the
> >behavior is more intuitive (that is, there are more situations where
> >.exe is preserved across file moves or copies, and fewer places where
> >.exe is appended on a whim if the source didn't have one).
> >
> >In general, cygwin does not care if the .exe is missing, but other
> >programs (particularly cmd) do, so it is better if PE-COFF files are
> >given the .exe extension.  But implementing it is tricky - for example,
> >in the case of 'cat a>  b', there is no way to tell at the time when b
> >is created whether it will be populated with PE-COFF contents (that is,
> >no way to tell whether the source was a literal 'a' or 'a.exe'), so you
> >will not get an .exe in that case.
> I'm just pondering the bold idea (probably to be discarded) that it
> *could* be detected by "magic number" checking, i.e. renaming a new
> file on-the-fly after a few bytes of PE-COFF have been written to
> its beginning... 8-)

We had a discussion on the cygwin-developer list and I also discussed
this with Eric on IRC and there's no 100% correct solution by guessing
if .exe should be appended or not, one way or another.  Your idea isn't
new, U/Win implements something along these lines.  But that would fail
just the same way as Cywin in a scenario in which you, for instance,
checkout a binary file without .exe suffix from a git or svn repository.
The new rename(2) implementation can fix a few scenarios, but it will
never be able to do the right thing every time.  The same goes for
changing the .exe suffix by checking what is written to the first few
bytes of a file.


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

- Raw text -


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