Skip to main content
11 events
when toggle format what by license comment
Apr 30, 2017 at 6:22 history edited Kusalananda CC BY-SA 3.0
added 12 characters in body
Apr 30, 2017 at 3:31 comment added R.. GitHub STOP HELPING ICE Also note that my approach has some limitations when there could be directories involved; these can be mitigated via additional tricks using temporary directories.
Apr 30, 2017 at 3:29 comment added R.. GitHub STOP HELPING ICE ln -sf is not atomic. It's specified to unlink the old symlink then make a new one, which is necessarily non-atomic. Instead you must make an additional temporary symlink and use the rename function (via the mv command, for instance) to atomically replace the old one. See my approach to it here: git.musl-libc.org/cgit/musl/tree/tools/…
Apr 29, 2017 at 14:32 history edited Kusalananda CC BY-SA 3.0
added 673 characters in body
Apr 29, 2017 at 14:25 comment added Kusalananda @MichaelKjörling Fixed it.
Apr 29, 2017 at 14:24 history edited Kusalananda CC BY-SA 3.0
added 673 characters in body
Apr 29, 2017 at 14:17 comment added user This isn't atomic, though. It's close to atomic, but not quite.
Apr 29, 2017 at 13:18 comment added Kusalananda @StephenHarris Yes, on systems that have those flags.
Apr 29, 2017 at 12:31 comment added Stephen Harris You may also want a chown --reference=backup-xx statistics ; chmod --reference=backup-xx statistics to set ownerships and permissions. Ideall you would do this before renaming, so a mkdir new ; chown ; chmod ; mv stats backup ; mv new stats type process.
Apr 29, 2017 at 12:18 vote accept Googlebot
Apr 29, 2017 at 12:05 history answered Kusalananda CC BY-SA 3.0