/tg/ Station 13 - Modules - Types — Proc Details

map

A map's graffiti file, held to GRAFFITI_MAP_MAX_BYTES.

Procs

write_textWrites the map's JSON as the graffiti stores' save() writes a tree (library.dm), with the revision kept as an md5: staged and checked first, then the backup made to hold the last verified revision, then the primary written and checked, then copied over the backup, so that once a write is done no file keeps what it dropped and an interrupted write of the primary still recovers the revision before. Each file is checked by its md5 against the text in hand, so nothing written is read back into text, and only the text's md5 stays. The backup is copied from the primary on disk. A backup that can't be copied then leaves the write standing, as the primary holds it, and the next write copies the backup again.

Proc Details

write_text

Writes the map's JSON as the graffiti stores' save() writes a tree (library.dm), with the revision kept as an md5: staged and checked first, then the backup made to hold the last verified revision, then the primary written and checked, then copied over the backup, so that once a write is done no file keeps what it dropped and an interrupted write of the primary still recovers the revision before. Each file is checked by its md5 against the text in hand, so nothing written is read back into text, and only the text's md5 stays. The backup is copied from the primary on disk. A backup that can't be copied then leaves the write standing, as the primary holds it, and the next write copies the backup again.

Trust rule: the primary holds the last verified revision, or the backup does after a failed write or a load from the backup; a revision in neither file means the file changed outside the server.

A write that succeeds, as a load from the primary does, leaves the primary holding the revision. So when it no longer does, unless the last write failed or the file was loaded from its backup, or when neither file does, the file changed outside the server: what the primary holds now, or else the backup, is kept as the backup instead until the next write, and the write goes ahead.

Arguments:

Returns: