X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-0.6 required=5.0	tests=AWL,BAYES_00,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Date: Tue, 4 Jan 2011 10:00:48 -0700 (MST)
From: David Mastronarde <mast@Colorado.EDU>
To: Eric Blake <eblake@redhat.com>
cc: cygwin@cygwin.com
Subject: Re: Cygwin-1.7.7: mv appends .exe to directory if matching .exe exists
In-Reply-To: <4D234B82.3000204@redhat.com>
Message-ID: <alpine.LRH.2.00.1101040952530.8516@druid.colorado.edu>
References: <alpine.LRH.2.00.1101040857070.8516@druid.colorado.edu> <4D234B82.3000204@redhat.com>
User-Agent: Alpine 2.00 (LRH 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
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 Tue, 4 Jan 2011, Eric Blake wrote:

> On 01/04/2011 09:27 AM, David Mastronarde wrote:
>>
>> When there is a directory and an executable with the same name, mv adds
>> .exe when renaming the directory:
>>
>> % mkdir test2
>> % cd test2
>> % mkdir package-3.1.1
>> % touch package-3.1.1.exe
>> % mv package-3.1.1 package-3.1.2
>> % ls
>> package-3.1.1.exe  package-3.1.2.exe/
>>
>> There is also a problem when there is an executable matching the name
>> being moved to:
>>
>> % mv package-3.1.2.exe package-3.1.2
>> % ls
>> package-3.1.1.exe  package-3.1.2/
>> % mv package-3.1.2 package-3.1.1
>> mv: cannot move `package-3.1.2' to `package-3.1.1': Not a directory
>>
>> This happens with the latest snapshot of cygwin1.dll.
>
> You CAN'T have a directory and an executable sharing the same name on
> Linux, so why should you try the same thing on cygwin?  Given that
> cygwin attempts to handle '.exe' as a necessary evil, and tries to
> recognize executables when the suffix is omitted, you are basically
> confusing cygwin by creating a directory and an executable with the same
> name.
>
> That said, there's probably room for improvement for recognizing the
> situation, and trying to be smarter when both directory and .exe
> executable exist; and the patch may need to be in coreutils rather than
> in cygwin1.dll (since cp is doing some extra legwork for .exe magic in
> the first place).  Good thing I'm building coreutils 8.9 today :)
>
> --

In my case, I am using Winzip to make an executable Zip file that ends up 
having the same name as the directory.  Every time I make a new version, I 
rename the directory as indicated.  This used to work, possibly even in 
early Cygwin 1.7

Think of this as similar to having an installer file named packagename.sh. 
Linux wouldn't confuse the directory packagename and the executable 
packagename.sh

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

