[PATCH] Add function to read an index file from an arbitrary filename.