make get_filecache take a file descriptor

Do even less direct manipulation of filepaths.