[MERGE] [BUG 363837] Catch _win32_delete_readonly failure to remove file or directory and try to recover

John Arbash Meinel john at arbash-meinel.com
Tue May 5 15:42:50 BST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> On Tue, 2009-05-05 at 13:54 +0900, Stephen J. Turnbull wrote:
>> Is there any way to determine which program has the file open?
> 
> sysinternals has a tool similar to lsof; if its not a transient problem
> you could use that. [Technically, walk the HANDLEs of all processes to
> find those matching the file].
> 
> Also, NamedTemporary file is in since at least python2.4.
> 
> -Rob

Though there is a nice "feature" of win32 and NamedTemporaryFile, in
that the file is opened exclusively by the single file handle you have
right now.

Put another way, no other process can open the named file, *nor* can the
current process open it a second time.

So I don't have any good idea what the "Named" portion is useful for on
Win32, since it can't be used to actually *do* anything with the file.

Note that this differs from the Linux usage, which is why we ran into
some small problems with the btree overflow code on Windows, as it
expected the current process could re-open the named file...

So it exists, but it is pretty much useless, which is probably why we
didn't use it.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkoAUGoACgkQJdeBCYSNAAMpVgCePWDSCnuDh84G7VHd7jc5v2/X
hMkAnjMjrS8hD2FpWRPJ0efQoIIOa865
=7yMH
-----END PGP SIGNATURE-----



More information about the bazaar mailing list