Re: any support for deleting an entry from cdb file?
"Arnold K." <[email protected]> Mon, 11 Apr 2005 15:44:40 -0400
| Newsgroups | gmane.comp.djb.cdb |
|---|---|
| Message-ID | <[email protected]> |
At 03:24 PM 4/11/05, Dev Man wrote: >Hi, > >Is there any way to delete records from the CDB database? >I looked at the CDB source code a bit but didn't see offhand. >If not, is it feasible to add? >or is it really limited to add/read operations? > >Thanks >Dev Yes it exists, but not in the source code nor in the way you ask. The same mechanism you use to add, you would use to delete by skipping the addition of the record you do not want into the new CDB from the current CDB file. i.e. this is a read current.CDB write current.CDB.tmp skipping the entries from current.CDB that you do not want. When the mechanism you use is complete current.CDB.tmp will be renamed to current.CDB. Arnold