teaching machines

Keystrokes File Format

June 3, 2013 by . Filed under keystrokes, public.

A Keystrokes text movie is composed of a number of frames. Each frame is currently stored in a separate file, and all metadata describing the frame is stored in the file name. The only thing inside the file is the text of the frame (or a diff describing how to construct it from the previous frame’s text). A filename has this format:

source-serialid-cursorline-cursorcolumn-timestamp

Source is the name of the original file whose editing got recorded. Serial id is the number of the frame in the frame sequence. This number gives no information about the time the frame was recorded. Cursorline and cursorcolumn record the position of the cursor at the time the frame was recorded. Timestamp records the time the frame was recorded. The value is produced by C’s strftime(“%s”), whose documentation has this to say about %s:

The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).

If storing the metadata like this ends up being a bad idea, we’ll fix it. Caveat emptor.