Re: spamprobe-1.1x7 released
Ray <[email protected]>
| Newsgroups | gmane.mail.spam.spamprobe.general |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Mar 28, 2005 at 06:17:57PM -0500, Brian Burton wrote:
> The cleanup and purge commands actually build a new hash file (necessary
> to rehash the file when records are deleted) and then swap it into place
> to replace the old one (using link/unlink). That means that crashing in
> the middle of a purge or cleanup won't leave the original file in an
> indeterminate state. The worst case would be if the kernel crashed
> after the old file was renamed but before the new one is renamed. That
> would be easy to recover from since the original file would still be in
> the directory (named sp_words.hash.bak).
Why not use rename(2)? I'm not sure about other UNIX-like OSes,
but OpenBSD's rename(2) claims:
rename() guarantees that if _to_ already exists, an instance
of _to_ will always exist, even if the system should crash in
the middle of the operation.
-Ray-
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click