3 ms·
> The standard procedure to overwrite a file is to save to a temporary file first … which on the other hand has the annoying side effect of wrecking hard links
by iggldiggl 4y ago
> The standard procedure to overwrite a file is to save to a temporary file first
… which on the other hand has the annoying side effect of wrecking hard links.
- TazeTSchnitzel 4y agoAnd various metadata!
- bombolo 4y agoI think that's a positive. So you had 2 identical files but one is now changed and they automatically got decoupled! Unless of course you wanted them to remain the same…
- eviks 4y agoYes I did, that's why I created them! For decoupled files you'd use copy
- Dylan16807 4y agoBut I don't want to waste disk space by storing the same data twice. And doing that with copies only works on a handful of filesystems, most notably BTRFS and XFS.
- geocar 4y agoIf you want them to remain the same, use symbolic links.
- iggldiggl 4y agoSymbolic links don't give me an easily obtainable list of all "copies" of that file, and while they might survive atomic writes, they're also vulnerable to the "main" file being renamed/moved/etc. (Of course the thing that'd solve my actual root problem would be proper OS and file system level support for tagging, but until then it seems that there are only imperfect solutions, each with its own set of drawbacks. I.e. third party software is not well integrated with the file explorer and the file open/save dialogues etc., and now I'm dependent on that software lest I lose all my carefully tagged data, whereas hard or symbolic link-based solutions are clunky to use and vulnerable to either atomic saves or file renaming etc.)