Make sure a path points to a file before attempting to read from it