Skip to main content

Module history

Module history 

Source
Expand description

What a shared file held before another device’s change was written into it (docs/database.md, “Earlier versions”), kept on this device only and never shared: <state>/share/history/<part>/<file>/<time>. Of each file, the last 20 versions are kept, and all those of the last 30 days; of a file no longer here, those of the last 30 days only; never more than a cap in all, the oldest going first. A note or a paper whose content a record named is kept by reference (<time>.sealed): its content is sealed in the sharing folder already, and stays there long enough. Any version can be put back (share::put_back): the file as it is then is kept first, and the next exchange sends what was put back as a change made here.

Structs§

Version
A version kept: its name (when it was kept), that moment (milliseconds), its size; kept by reference, its content’s hash (sealed in the sharing folder).

Enums§

Kept
Where a version is: a copy here, or a content sealed in the sharing folder.

Constants§

ACCOUNTS
The part of the history that holds your calendars’ and contacts’ versions set aside: an item changed both here and on its server, the server’s version kept, yours kept here (dav), to be put back from the window, on a phone too, whose state folder no file manager reaches. Its files are named by their place in the data folder (data/calendars/<account>/…).
DAY 🔒
DAYS
Days during which every version is kept.
SEALED 🔒
A version kept by reference: its name ends so.
SEALED_DAYS
Days a version kept by reference stays: its content stays in the sharing folder 90 days after a record last named it (blobs::UNUSED_DAYS).
VERSIONS
Versions kept of each file, however old.

Functions§

below 🔒
A file’s folder of versions: its name in the records, as a path below its part’s folder, never outside it, on Windows too.
cap
What the history may hold in all: a GB, or a twentieth of the disk if less.
files
The files of a part with versions kept, the one changed last first: each with its versions, the newest first.
keep
A file as it is now, copied before another device’s change is written over it, or takes it out; then the oldest versions past what is kept go. Refused when the copy would leave the disk short (disk::kept_free): nothing is written over a file whose copy could not be kept.
keep_bytes
Bytes kept as a version of file (a calendar’s item set aside, ACCOUNTS), as keep keeps a file: under a hidden name, then renamed. Returns where.
keep_sealed
A file’s content kept by reference: a record named it, so it is sealed in the sharing folder already; nothing copied.
kept_at
When a version was kept (milliseconds), from its name.
name_of 🔒
new_stamp 🔒
A name for a new version in dir, none taken.
part_dir 🔒
A part’s folder in the history: one plain name, never outside it.
plain 🔒
prune
The history held within bounds, now and then: each file’s versions as keep keeps them, those of a file no longer here (here says which are) past 30 days, then the oldest copies past cap bytes in all. Your versions of calendars’ and contacts’ items (ACCOUNTS) are kept as those of a file still here: the last 20, and all those of the last 30 days.
prune_file 🔒
A file’s versions past what is kept taken out: beyond the newest 20, those older than 30 days (all of those when the file is no longer here), and those kept by reference past SEALED_DAYS.
root
Where versions are kept: beside the sharing’s memory (<state>/share/history).
stamp 🔒
A version’s name: when it was kept, in UTC, to the millisecond (“2026-10-05T14-05-33.120Z”).
version
Where a version kept is, if it is there: never outside the history.
versions
A file’s versions, the newest first.
versions_in 🔒
The versions in a file’s folder, the newest first.
walk 🔒
A folder holding versions is a file’s; the others hold files’ folders.