2 ms·
Noncooperative shared text documents only kind of work at the user level like in notepad++ or vscode where it keeps an eye on the timestamp and offers to lose e
by pjc50 7y ago
Noncooperative shared text documents only kind of work at the user level like in notepad++ or vscode where it keeps an eye on the timestamp and offers to lose either the edits in memory or the edits on disk. Inserting things into the middle can't be done without rewriting everything after.
The only thing that does work with shared writing is logiles with O_APPEND, where multiple processes can safely add to the end of a file.
(For historical examples of this, have a look at mbox locking versus maildir; the "mbox" format is basically keeping all your email as a huge text file, and locking protocols have developed around that so multiple mail clients can coexists without wrecking it)