A cheaper thing to do would just be to calculate the file size. That
would probably trap most corruptions of the writing process.
Wayne
On Thu, 27 Sep 2007, Wayne Boucher wrote:
> But this makes me wonder whether we should get even more paranoid and
> after saving the contents to disk then re-open the file for reading in
> order to do a checksum and see if there is a mismatch with what was
> written to the file. This would have to be done in the API, and I'm not
> sure whether Rasmus would be that keen on this (it would slow the save
> down, perhaps by a lot, because of the checksum calculation having to be
> done twice, and reading the file from disk). If there is a mismatch you
> would have to assume your file was corrupted, and so would have to do
> another save.
>
> Wayne
>
>
|