branch locking mk2.
Martin Pool
mbp at sourcefrog.net
Mon Feb 13 13:06:08 GMT 2006
On 8 Feb 2006, Jan Hudec <bulb at ucw.cz> wrote:
> Rename *IS* atomic on windows. Atomic means, in this case, it either
> happens, or not, but nothing in the middle. If the dst already exists,
> and is a directory (which is the case), directory rename never succeeds,
> no matter what system.
Perhaps surprisingly, directory rename overwrite will succeed on Unix if
the directory to be overwritten is empty:
mkdir /tmp/a /tmp/b
mv /tmp/a /tmp/b
succeeds - even if you write a small program that makes the rename
syscall directly. This does trap properly:
mkdir /tmp/a /tmp/b
touch /tmp/b/bfile
mv /tmp/a /tmp/b
In any case it is useful to put a file inside to carry information (as
ddaa asked) and to make sure which instance is really in place.
--
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060214/d48543c6/attachment.pgp
More information about the bazaar
mailing list