I would think just not writing the file on failure would be preferable?