Hacker News new | ask | show | jobs
by asb 6241 days ago
It would be nice if DJB would release CDB under the public domain like he has now done with most of his other software. However, there's a great public domain implementation by Michael Tokarev I'd recommend: http://www.corpit.ru/mjt/tinycdb.html
2 comments

A caveat to TinyCDB in Windows:

Don't forget (In Windows) to specify O_BINARY eg:

  O_RDONLY |O_BINARY
Also the case in Berkeley DB 1.86.

Otherwise it opens a file in ASCII mode, when Windows writes \r\n when it reads in \n... , and dies after just a few records.

I have a Lua binding to tinycdb. I hadn't considered Windows compatibility and this bug exists in my code. I've just committed a fix, thanks.
The first lines of cdb.c and cdb.h read "/* Public domain */". I would expect DJB to spell this out more explicitly if he releases an updated cdb package. I say "if" because the last release was Feb 2000.
I hadn't noticed that. Wikipedia explains the licensing in more details (http://en.wikipedia.org/wiki/Constant_Data_Base#Library) - the library code is public domain (and included in the public domain djbdns), but the rest of the package is under djb's annoying "You may distribute unmodified copies" license.