State¶
State¶
- class preader.State¶
Bases:
objectSaved progress of an iterator over one file
Saving an iterator or loading from the registry returns one, and passing it back as the
stateof a new iterator resumes from it- file¶
Metadata of the tracked file, recorded when the state was created or last resynced
- name¶
Name the state is saved under
- percent()¶
Returns
positionas a share of the recorded file size, from 0.0 to 100.0It returns 0.0 for an empty file
- position¶
Byte offset just past the last finished item, where a resumed iterator starts
- timestamps¶
Times the state was created and last saved or resynced
FileMetadata¶
- class preader.FileMetadata¶
Bases:
objectPath, size, modification time and fingerprint of a state’s tracked file
The metadata is recorded when the state is created or resynced and is never refreshed by a save. After the file grows, resuming reads only up to
size, or fails with a size mismatch whenverify_stateis on, until a resync records the file again- fingerprint¶
SHA-256 hex digest of the first 4096 bytes of the file
- mtime¶
Modification time of the file, at microsecond precision
- path¶
Path of the file, canonical when recorded by an iterator or a resync
- size¶
Size of the file in bytes, where reads stop