Ask a Question related to UNIX Programming, Design and Development.
-
Ollie Cook #1
mkstemp (equivalent?) and berkely dbopen
Hi,
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.
Cheers,
Ollie
--
Ollie Cook Systems Administrator, Claranet UK
Ollie Cook Guest
-
PHP equivalent to MOD
Hi, I need to see if a number is divisible by 2. I don't see the math function "mod" in my PHP Functions reference manual. Is there another way... -
equivalent to php_info()
Hi again, is there an equivalent system plot like php_info() in asp? thanks, tom -
php equivalent of CGI.pm
I'm translating several old cgi scripts (that use CGI.pm) to php. CGI.pm has a series of conventient function calls for generating HTML code on the... -
Is mkstemp() large file aware/compatible?
Dragan Cvetkovic <me@privacy.net> writes: Yes on Solaris. (As documented in the manual page) Casper -- Expressed in this posting are... -
ACT! Equivalent for Mac?
Does anyone know if there is a Macintosh program whose features are roughly equivalent? This PC software runs on VPC, but is fairly sluggish.... -
Jens Schweikhardt #2
Re: mkstemp (equivalent?) and berkely dbopen
Ollie Cook <news@mutare.noc.clara.net> wrote
in <slrnbgjgr4.310o.news@mutare.noc.clara.net>:
# Hi,
#
# 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.
What exactly is the race for your app?
# Any pointers in the right direction would be greatfully received. I'm
# programming in C on FreeBSD, but portable options would be preferred.
Does mkstemp(3) solve your problem?
Regards,
Jens
--
Jens Schweikhardt [url]http://www.schweikhardt.net/[/url]
SIGSIG -- signature too long (core dumped)
Jens Schweikhardt Guest
-
Ollie Cook #3
Re: mkstemp (equivalent?) and berkely dbopen
On 8 Jul 2003 07:27:33 GMT, Jens Schweikhardt wrote:
Overwriting a db file causes processes which want to read it to not be> What exactly is the race for your app?
able to as the data obviously becomes inconsistent.
The data has to always be available to client applications so the
solution is to write to a temporary file and move that over the top
atomically.
mkstemp is not suitable since it returns a file descriptor, not a DB> # Any pointers in the right direction would be greatfully received. I'm
> # programming in C on FreeBSD, but portable options would be preferred.
>
> Does mkstemp(3) solve your problem?
pointer. dbopen(3) explains the interface to dbopen.
Thanks for your reply.
Ollie
--
Ollie Cook Systems Administrator, Claranet UK
Ollie Cook Guest



Reply With Quote

