X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 	tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <4B24DB01.2040201@t-online.de>
Date: Sun, 13 Dec 2009 13:16:01 +0100
From: Christian Franke <Christian.Franke@t-online.de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: overwriting an in-use executable
References: <416096c60912130019s5188fdd9w2f561005ba2c8c69@mail.gmail.com>
In-Reply-To: <416096c60912130019s5188fdd9w2f561005ba2c8c69@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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

Andy Koppe wrote:
> cp and mv behave differently when trying to overwrite an in-use executable:
>
> $ cp mintty.exe /bin
> cp: cannot create regular file `/bin/mintty.exe': Device or resource busy
>
> $ mv mintty.exe /bin
> [works fine]
>
> That's on 1.7. On 1.5, both cp and mv fail.
>
>    

Same when trying to 'rm' an in-use executable: Works on 1.7, fails with 
'Permission denied' on 1.5. Cygwin 1.7 works like Linux here. I don't 
know whether POSIX requires this behavior.

The difference probably occurs because 1.7 now uses 
NtSetInformationFile() instead of MoveFileEx() and DeleteFile().

Christian


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

