Expand description
External files a lowering read, with the fingerprint each had at the
time, so a cached LowerResult can be checked
against the filesystem before it is reused (issue #125).
StructsΒ§
- Dependency
Set π - The dependencies observed so far while lowering one document, keyed by path so a file read twice is recorded once.
- External
Dependency - One external file a lowering depended on: an
#image/#figureraster or a#bibliographysource. - External
Inputs π - What a directive lowerer needs to touch the filesystem: the
.mosfile paths resolve against, and the set that records every file it reads. - File
Identity - The device and inode numbers and the status-change time of a file on
Unix. Unlike the modification time, none of these can be set from
userspace, so a rewrite that restores the old mtime still moves one of
them. Every field is
Noneon platforms that do not expose them. - Fingerprint
- What a regular file looked like when it was read: its
statfields, the moment thatstatwas taken, and afingerprint_byteshash of its contents.
ConstantsΒ§
- DOMAIN_
TAG π - RACY_
WINDOW - A modification time this close to the moment the fingerprint was taken is
not trusted by
ExternalDependency::is_current: a second write inside the same filesystem timestamp tick would leavestatunchanged. Two seconds covers FATβs timestamp resolution.
FunctionsΒ§
- fingerprint_
bytes - Fingerprint raw file bytes for dependency comparison.
- fingerprint_
file - The
Fingerprintof the regular file atpath, orNonewhen there is no readable regular file there. Directories, devices, and pipes are never opened. - read_
fingerprinted π - Read the regular file at
pathand fingerprint it in one pass. Thestatis taken before the read, so a write that lands between the two shows up as a changedstaton the nextExternalDependency::is_currentand forces a hash comparison. - regular_
file_ πmetadata