cpu: check whether output file has been successfully opened for writing