mods to support efficient EOF seek for KeyFile