Re: any support for deleting an entry from cdb file?

Bennett Todd <[email protected]> Mon, 11 Apr 2005 19:41:30 +0000
Newsgroups gmane.comp.djb.cdb
Message-ID <[email protected]>
--7JfCtLOvnd9MIVvH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

2005-04-11T19:24:33 Dev Man:
> Is there any way to delete records from the CDB database?

Sure --- delete them from the pre-image, then rebuild the CDB
database.

CDB is Constant DataBase, write-once.

The lifecycle of a .cdb file is, it's created once --- preferably
in a tmp file that's moved into place with atomic rename(2). Then
one or more readers open is to read, and read from it as long as
they want, doing as many queries as they want. If the readers
periodically check, between reads, via re-opening the file or just
stat(2)-ing it to see if it's changed, they can see updates ---
rewrites --- in a timely fashion while avoiding any danger of a
corrupt read from the file being updated mid-read.

-Bennett

--7JfCtLOvnd9MIVvH
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCWtLqHZWg9mCTffwRAgrRAJ9uK9BXNPsiJlipB57egxZ6reRGSgCeMpFH
7Inr1B+dTD74RGBp0koWN6k=
=HjdL
-----END PGP SIGNATURE-----

--7JfCtLOvnd9MIVvH--