News for hackers. Stuff that matters.
Re:How to change symlinks atomically (2005) by rincebrain on Sunday August 21, 2016 @02:53AM (#12329748)
I'm not sure which is wrong, the person writing or the documentation, but rename() claims to be atomic with few exceptions even when overwriting an existing item.[1]

The only reason I suspect things do unlink-then-rename is that (evidently) rename() doesn't promise anything about what happens to the "src" item if rename() fails, just that something will still be in "dest".[1]

But I don't know why the commands do something different, and don't want to try reading the source of either GNU or BSD mv to find out why.

[1] - http://pubs.opengroup.org/onlinepubs/009695399/functions/ren...

There are no comments on this comment yet.