cache.c: use file_expand(), handle errors