[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: SVN need to delete/create-temp/rename files instead of simply ove rwriting them (suggestion how to workaround)

From: Norbert Unterberg <nepo_at_gmx.net>
Date: 2004-12-05 19:55:19 CET

Ben Collins-Sussman schrieb:

> [...] The renaming that you see
> happening in .svn/ is quite deliberate, and it's used to guarantee that
> files come into existence atomically.

What procedure are you using to replace the original file in one
operation? Usually the required delete-rename or rename-rename-delete
operations are still distinct operations, and there is a moment where
the original file does not exist in the working copy.

> File data arrives slowly from
> the network, spooled into a tmpfile, then the tmpfile is moved to be
> come the "real" file in one step.

Please help me: What is so important to make the working copy file
operation atomic? Couldn't the file could be locked during the
operation? If a svn crash or interruption is your concern, the user
needs to run svn cleanup afterwards anyway, which could take care of the
incomplete operation when it finds the temp file.

BTW, on Windows you could use the ReplaceFile() API where available.
That would make both parties happy...


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Dec 5 19:56:27 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.