import mmap import struct from pathlib import Path def iter_offsets(offset_file: str): skip_header = False with open(offset_file, "rb") as f: if skip_header == False: print(f.read(8)) skip_header = True while chunk := f.read(4): if len(chunk) != 4: raise ValueError("Incomplete 4-byte offset at end of file") #yield struct.unpact("