dirstate2 comments

John Szakmeister john at szakmeister.net
Mon May 31 16:11:43 BST 2010


On Mon, May 31, 2010 at 10:03 AM, Martin (gzlist) <gzlist at googlemail.com> wrote:
> On 31/05/2010, Alexander Belchenko <bialix at ukr.net> wrote:
>> Martin Pool пишет:
>>>  * however, we also cannot count on being able to
>>> delete/rename/overwrite a file while it's being read (because this
>>> doesn't work on windows)
>>
>> Hmm, I'm not sure but I was under impression that using Win32 API it's
>> possible to open the file in shared mode and allow simultaneous read and
>> rename/delete. I might be wrong of course, but I saw something similar
>> implemented in hg sources. Maybe somebody like Martin gz can look on
>> this with suspicious eye?
>
> Ha, yes, I thought we'd discussed this before:
> <https://lists.ubuntu.com/archives/bazaar/2009q3/062748.html>
>
> It's not the same thing as nix file handing in that it remains in the
> namespace until all handles are closed, so you still can't rename over
> a live file.
>
> Every time this topic has come up I've wanted to mention NTFS
> transactions, which seem like The Right Way of doing this sort of
> thing on modern windows systems, but I don't actually know anything
> about them (or have a new enough OS).

I haven't tried this, but would MoveFileEx() with the
MOVEFILE_REPLACE_EXISTING work?

-John



More information about the bazaar mailing list