fail if the path is not a file