From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1113 invoked by alias); 2 Mar 2004 20:52:55 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 1105 invoked from network); 2 Mar 2004 20:52:54 -0000 Received: from unknown (HELO redhat.com) (66.187.230.200) by sources.redhat.com with SMTP; 2 Mar 2004 20:52:54 -0000 Received: by redhat.com (Postfix, from userid 201) id 31FF240015D; Tue, 2 Mar 2004 15:53:00 -0500 (EST) Date: Tue, 02 Mar 2004 20:52:00 -0000 From: Christopher Faylor To: "Gdb@Sources.Redhat.Com" Cc: Kris Warkentin Subject: Re: File locking of target executable Message-ID: <20040302205300.GB11909@redhat.com> Mail-Followup-To: "Gdb@Sources.Redhat.Com" , Kris Warkentin References: <4044F049.6060009@qnx.com> <4044F174.10004@qnx.com> <20040302204402.GA20170@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040302204402.GA20170@nevyn.them.org> User-Agent: Mutt/1.4.1i X-SW-Source: 2004-03/txt/msg00016.txt.bz2 On Tue, Mar 02, 2004 at 03:44:03PM -0500, Daniel Jacobowitz wrote: >On Tue, Mar 02, 2004 at 03:41:24PM -0500, Kris Warkentin wrote: >>Argh. I always see the answer AFTER I mail to the mailing list. Looks >>like Windows itself won't let a binary be removed if it's executing. >>The problem report states that this is happening in the remote case but >>I just checked and it doesn't seem to be. Must be an error in the bug >>report. > >It can happen in the remote case too sometimes - I don't think Windows >lets you delete an open file either. It depends on the version of Windows and it depends on how the file is being deleted. Cygwin uses delete-on-last-close type of semantics in unlink() so that should work in cases where cygwin is being used. If you're not using Cygwin, but you are using Windows NT, you could investigate using the DELETE_ON_CLOSE argument to CreateFile as a method for (eventually) deleting an open file. cgf