[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: Branko Čibej <brane_at_xbc.nu>
Date: 2004-12-06 08:34:13 CET

Norbert Unterberg wrote:

> Could you please define the term "atomic replacement"? I do not know
> of a portable (ANSI-C OS-independent) way to replace one file by
> another in one atomic opearation.

"Portable", when it comes to manipulating files, is almost never "ANSI-C
OS-independent".

> You need to push the original file aside before renaming the new one
> to the original name, and that makes it two operations,

No. What you describe /used/ to be true on Windows, but no longer is.
These days Windows lets you do what Unix allowed since day one, that is,
rename a file over an existing target. And that rename is atomic.

> leaving the working copy without the "real" file for a short moment.
> Or did I miss something?

Yes. :-)

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Dec 6 08:34:46 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.