Malcolm Beattie said:
> ln foo foo.bak
...
> cp foo newfoo
...
> mv newfoo foo
> Atomically replaces the directory entry foo: before the
> command (specifically: before the system call "rename" that
> mv does for you), opening "foo" refers to the old file; after
> it, opening "foo" refers to the new file. At no time is there
> a window where no file named "foo" exists and at no time is
> there a window where both exist or get mixed up in any way.
And furthermore DOES NOT HARM "foo.bak", correct?
I think this is why I have never used the above sequence
of atomic operations: I did not trust it to leave "foo.bak" intact.
But you could help set my soul at rest about this matter.
And if it is true on Linux, is it also true on HP, Sol, AIX, ad nauseum?
This forum is devoted to Linux, but we all continue to need to consider
other flavors of UNIX for maximum portability. We just need to know.