<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Olly Betts wrote:
<blockquote cite="mid20041004162634.GC13429@survex.com" type="cite">
<pre wrap="">On Mon, Oct 04, 2004 at 05:05:44PM +0100, Sam Liddicott wrote:
</pre>
<blockquote type="cite">
<pre wrap="">But if I use symlinks (and I do) in /var/lib/omega/data to point to the
db - well as we know, its impossible to atomically update a symlink, so
I can't update another DB and then symlink to it once done.
</pre>
</blockquote>
<pre wrap=""><!---->
Do we know that?
You can certainly create a new symlink with a temporary name, then use
rename() to replace the old symlink with the old one. And according to
"man 2 rename":
If newpath already exists it will be atomically replaced (subject to a
few conditions - see ERRORS below), so that there is no point at which
another process attempting to access newpath will find it missing.
Nothing in the ERRORS section seems to say that symlinks aren't replaced
atomically.
</pre>
</blockquote>
You're smart.<br>
<br>
Sam<br>
</body>
</html>