X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Thu, 5 Nov 2009 19:17:34 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: src/winsup/cygwin ChangeLog syscalls.cc
Message-ID: <20091105181734.GS26344@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20091105144413.31963.qmail@sourceware.org>  <4AF30801.7090508@users.sourceforge.net>  <20091105173450.GQ26344@calimero.vinschen.de>  <20091105180847.GA1918@ednor.casa.cgf.cx>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20091105180847.GA1918@ednor.casa.cgf.cx>
User-Agent: Mutt/1.5.20 (2009-06-14)
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 Nov  5 13:08, Christopher Faylor wrote:
> On Thu, Nov 05, 2009 at 06:34:50PM +0100, Corinna Vinschen wrote:
> >Let's see:
> >
> >  rename ("foo.exe", "perl5.10.0.exe")  result: perl5.10.0.exe
> >  rename ("foo.exe", "perl5.10.0")      result: perl5.10.0
> >  rename ("foo", "perl5.10.0.exe")      result: perl5.10.0.exe
> >  rename ("foo", "perl5.10.0")          result: perl5.10.0
> >
> >The latter one is a problem, because that's what happens when calling
> >
> >  strip perl5.10.0
> >
> >so after strip the binary is missing a .exe suffix.
> >
> >Sigh.
> >
> >Is there any *reliable* solution to this problem, other than never to
> >add a .exe suffix?
> 
> Isn't the reliable-but-slow method to check the magic at the beginning
> of the file to see if it actually is a .exe?  I'm not sure we want to do
> that though.

That's what already is done by calling GetBinaryTypeW on the source
file.  The problem is that the desired target name could actually
be "foo.sys" or "flub.com", as outlined in
http://cygwin.com/ml/cygwin/2009-11/msg00106.html


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

