X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Thu, 9 Oct 2008 15:05:40 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: cygwin-1.7: mv appends .exe extension to .bat and .com files
Message-ID: <20081009130540.GA9289@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <0MKr6C-1Kl4Ya1pOX-000Qp8@mx.kundenserver.de> <20081002090144.GA23019@calimero.vinschen.de> <20081009100432.GR9289@calimero.vinschen.de> <48EDFDAD.9020407@bmts.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <48EDFDAD.9020407@bmts.com>
User-Agent: Mutt/1.5.16 (2007-06-09)
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 Oct  9 08:48, Ralph Hempel wrote:
> Corinna Vinschen wrote:
>> On Oct  2 11:01, Corinna Vinschen wrote:
>>> On Oct  1 09:27, Herb Maeder wrote:
>>>> With a fresh install of cygwin-1.7 on a vanilla Vista system, I see that
>>>> the 'mv' command appends a .exe extension to the destination file for 
>>>> any
>>>> source files that have a .bat or .com extensions.
>
> <SNIP>
>
>> That should be fixed now in CVS.
>
> Might this issue also affect the operation of "install" with
> cygwin-1.7 on a vanilla XP-SP3?
>
> <http://cygwin.com/ml/cygwin/2008-10/msg00110.html>
>
> Install seems to strip the .exe extension in the process of copying
> files to the destination directory.

Install *copies* files.  The resulting filename is not under control of
Cygwin but exclusively under control of the copying application.  This
is different from rename and link which are OS functions and thus
implemented in Cygwin.s

To add to the confusion, try `install -s' which will add the .exe
extension to the resulting file.  The reason is that install calls
strip on the copied file and strip calls rename at one point, which in
turn adds the .exe extension.

Actually it would be possible to change the filename at copy time by
keeping track if a write to a file is the first write and if the bytes
to write are equivalent to a PE/COFF header.  If so, Cygwin could
rename foo to foo.exe without bothering the application.  That's what
U/WIN does.  I'm not yet sure if that's something we want to do, too.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

