3 ms·
“Emacs for example does create a new file and rename it over the old one when you save, usually, allocating a new inode as you say. By default it makes an excep
by sillysaurusx 5y ago
“Emacs for example does create a new file and rename it over the old one when you save, usually, allocating a new inode as you say. By default it makes an exception if there are other hardlinks to the file.”
Though the trade off is that all operation ceases on a full hard drive.
I don’t have a better solution, but it’s worth noting.
- kragen 5y agoEmacs gives you an error message in that case rather than destroying the old version of the file and then failing to completely write the new version, in the cases where it does the tempfile-then-rename dance. This is usually vastly preferable if Emacs or your computer crashes before you manage to free up enough space for a successful save. It doesn't cease all operation; other Emacs features work as they normally do. Bash, by contrast, stops being able to tab-complete filenames, at precisely the time when you most need to be able to rapidly manipulate your files. At least, that's the case with the default completion setup in a few recent versions of Ubuntu.
- thaumasiotes 5y agoWell, it looks like creating another hard link is a nearly-free solution. And beyond that, since emacs already has both behaviors, presumably you can tell it you want the in-place modification.
- kragen 5y agoI think you can just customize the backup-by-copying variable to t, though I haven't tried it. Check the manual.
- vbezhenar 5y agoDoes it mean that I need to have extra free space? Does not sound good.