restrict reads to a range in a file