The sibling comment provided a good hint already. All you need to store are some file offsets, amounting to a few dozen bytes.