# fixity

> **Tool `tools/triage/fixity.py`** (program, Triage). Keep a copy of a game unchanged over the years, and prove it: package it as a BagIt bag with a checksum for every file, and check the checksums again whenever you like.

Run it with `./gameframe run fixity ARGS` or `python3 tools/triage/fixity.py`. [Source on GitHub](https://github.com/tanepiper/game-frame/blob/main/tools/triage/fixity.py).

## Its own help

This is the help text in the tool itself, as `./gameframe tool fixity` prints it.

```text
Keep a copy of a game unchanged over the years, and prove it: package it as a BagIt bag with
a checksum for every file, and check the checksums again whenever you like.

Usage: fixity.py bag SOURCE BAG [--info KEY=VALUE ...]   copy SOURCE into a new bag
       fixity.py manifest FOLDER [OUT]                    checksums of a folder, in place
       fixity.py verify BAG|FOLDER|MANIFEST               check every file against its checksum

  bag        BAG/data/ holds the files; BAG/manifest-sha256.txt their checksums; bag-info.txt the
             date, the size (Payload-Oxum) and any --info lines, such as
             Source-Organization=..., External-Description="GOG release 1.2, installer 5.1";
             tagmanifest-sha256.txt the checksums of those files in turn
  manifest   writes FOLDER/manifest-sha256.txt (or OUT) for files you keep where they are,
             such as target/ in a project
  verify     reports every file that changed, went missing or was added. Exit status 1 when
             anything differs

Digital preservation calls this fixity: knowing that a file is still exactly what it was.
Storage fails slowly and quietly, and copies drift as people work on them. The BagIt layout
(RFC 8493, from the Library of Congress) is the common way libraries and archives package
files with their checksums, and many tools read it. A bag of the game as you received it,
checked now and then, is the reference every finding goes back to
(docs/working/preservation.md). Bags of game files are game material: keep them outside git.
Standard library only.
```

## Named by

Skills: [re-inventory](/skills/re-inventory).
