[RFC] race-free-rename ?

Martin Pool mbp at sourcefrog.net
Tue Oct 16 09:28:42 BST 2007


On 10/16/07, Robert Collins <robertc at robertcollins.net> wrote:
> So, for packs, I'd like a rename() which is guaranteed race-free. That
> is, it should fail if it cannot atomically rename the source to the
> destination (e.g. if the destination already exists and the fs does not
> support rename-over-the-top).
>
> thoughts? comments on how to expose it?

I think that every underlying transport or fs should be able to do
either one of these behaviors so it would be reasonable to add a
method to do it.  I would suggest adding a new one, maybe
rename_atomically_or_fail.  'race free rename' might imply various
strange things depending on who reads it.

-- 
Martin



More information about the bazaar mailing list