delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/23/11:23:21

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Thu, 23 Jan 2003 11:22:15 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Randall R Schulz <rrschulz AT cris DOT com>
cc: cygwin AT cygwin DOT com
Subject: RE: Bug in rm -r with locked files
In-Reply-To: <5.2.0.9.2.20030123075017.01d8fe08@pop3.cris.com>
Message-ID: <Pine.GSO.4.44.0301231114240.23429-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Thu, 23 Jan 2003, Randall R Schulz wrote:

> Chris J.,
>
> At 02:47 2003-01-23, Chris January wrote:
> > > It's not a completely intractable problem.  I think that someone (Chris
> > > January?) provided a workaround at one point.  "cygserver" could also
> > > provide a possible solution someday.
> >
> >The best solution, IIRC, was to move the locked files elsewhere on the same
> >volume (which should be allowed) if they can't be unlinked, and then unlink
> >them later. So there would be a directory of files waiting to die if you
> >like :) Obviously you'd have to give them unique names, but you can just use
> >random numbers.
>
> Again, I think this misses the point. While Windows sees the file as
> open (or a directory that is current for some process), it cannot be
> renamed, relocated or deleted, can it? I know very little about the
> Windows APIs, but the behavior I see from Windows strongly suggests
> this is the case. Is there some kind of override to these common
> "interlocks" that Windows imposes? Are they only strictly enforced in
> Windows Explorer?
>
> Randall Schulz

Randall,

These "interlocks", at least as far as renaming goes, might in fact be
restricted to Windows Explorer.  It seems possible (from the limited
testing that I did) to rename a file that is locked, or move it to another
directory on the same volume.  If I may venture a guess, Windows Explorer
is unable to move a locked file because it implements move as copy/delete
to avoid special-casing for same-volume moves.

I've had a similar problem with cvs trying to remove lock directories on
samba drives.  While not necessarily related (I had no infinite loops,
just a "permission denied" on remove), I was able to rename or even move
the directory (while it was considered locked), as long as it was on the
same volume.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019