I would like to create a database using dbopen(3) with a random unused
filename, and to copy that over the 'live' database once it's been
completely flushed to disk, in an effort to always have the live
database containing valid data.
What is the safest way of achieving this? Obviously using mktemp(3) to
generate a filename, and then opening that file contains a race
condition and should be avoided.
Any pointers in the right direction would be greatfully received. I'm
programming in C on FreeBSD, but portable options would be preferred.
Ollie Cook Systems Administrator, Claranet UK