Re:Ask HN: Why don't file systems and OS's provide file syst...
by marcell on Friday July 22, 2022 @11:40PM
(#32200103)
Move in Unix is atomic, which handles a lot of the common use cases for a transactional file system.
[ Parent
| on HN ]
Re:Ask HN: Why don't file systems and OS's provide file syst...
by bhawks on Saturday July 23, 2022 @12:43AM
(#32200448)
Move _on_ the same filesystem/partition is atomic ;).
Re:Ask HN: Why don't file systems and OS's provide file syst...
by beagle3 on Saturday July 23, 2022 @03:03AM
(#32201082)
and only on _files_. If you want to atomically replace a whole directory. "move" alone can't do it - though you can compensate with a symbolic link.
Re:Ask HN: Why don't file systems and OS's provide file syst...
by mook on Saturday July 23, 2022 @02:34AM
(#32200944)
Isn't that only specified (for the same filesystem, as mentioned) for Linux? As far as I can tell the only thing POSIX specifies came from ISO C:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/r...
ISO C 9899:2018 (actually the 2017 draft) says in 7.21.4.2.3 that on a failure return the file is available by its original name, but that's a much weaker guarantee as that doesn't say anything about failing to return (e.g. hard system crash)…
Re:Ask HN: Why don't file systems and OS's provide file syst...
by IgorPartola on Saturday July 23, 2022 @12:20AM
(#32200324)
creat is as well if you do the magic correctly. Well except if the file system is network mounted. Maybe. And if another process respects what you are doing.