This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: File locking of target executable


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]