Re: Safe File Update (atomic)
On Thu, Dec 30, 2010 at 4:12 PM, Shachar Shemesh <email@example.com> wrote:
> No. I was doing it as code to accompany an article on my company's site
> about how it should be done. I was originally out to write the article, and
> then decided to add code. A good thing, too, as recursively resolving
> symbolic links is not trivial. There is an extremely simple way to do it on
> Linux, but it will not work on all platforms (the *BSD platforms, including
> Mac, do not have /proc by default).
Depending on /proc is probably not reasonable.
Are you sure it will be atomic? ;)
>> What aboue file owner? Meta-data (ACL)?
> The current code (I'm still working on it, or I would have released it
> already, but it's about 80% done) does copy owner data over (but ignores
> failures), but does not handle ACLs. I decided to postpone this particular
How do you preserve owner (as non-root)?
> hot potato until I can get a chance to see how to do it (i.e. - never had a
> chance on Linux) AND how to do it in a cross-platform way (the code is
> designed to work on any Posix). Pointers/patches once released are, of
> course, welcome :-)
The reason I asked for a kernelland solution is because it's hard if
not impossible to do properly in userland. But some kernel devs (Ted
and others) don't agree. They reason that the desire to preserve all
meta-data isn't reasonable by itself.