On Thu, 2004-12-02 at 18:40 -0500, Daniel Veillard wrote: > On Thu, Dec 02, 2004 at 04:59:49PM -0500, Colin Walters wrote: > > On Thu, 2004-12-02 at 16:38 -0500, Daniel Veillard wrote: > > > > > If the kernel has an atomic rename system call then it can be done > > > without race, if not that will be a very serious issue. > > > > It has an atomic rename for files; but you can't atomically change a > > directory that has content. Or am I missing something? Not to mention > > this would break things like RPM verification. > > I think you're missing something. It is possible to copy the file > somewhere else and then rename it to the original name, First, something could change the file while it is being copied. Second, something could change the file (e.g. delete it) after you've copied it, but before the rename. Not to mention that when you are walking a directory tree, it could have been changed in any way. I am worried about a solution like this, because it basically requires that nothing else touches the entire directory tree while it's happening. If you do this late on shutdown, maybe we'd get away with it. Was that your plan?