Ensure the file is not a directory.