Expand description
Private temporary files: a part for a mailcap %s command, a
signature for gpg, a draft for the editor. They live in the shared
temp dir, so each is created fresh (O_EXCL: never through a link or
over a file someone else put there) and readable by us alone.
Functions§
- discard
- Remove a file
write_namedmade, and its directory with it. - save_
private - Replace
pathwithbyteswhole, readable by us alone: written beside it (mode 0600, synced) and renamed over it, so a crash leaves the old file or the new one. For what rmut keeps of the user’s own, such as the prompt history. - write
bytesin a new filermut-<what>-<unique><suffix>under the temp dir, mode 0600. The caller removes it.- write_
named bytesin a file calledname(a part’s own name, which tells a viewer its type) inside a fresh directory of ours: the directory is created new (never one someone put there first) with mode 0700, the file inside with 0600.discardtakes both away again.