Don't close the file if it wasn't successfully opened.
Give an error on failure to open a file.