perl4.003 and ndbm

John Macdonald jmm at eci386.uucp
Sat May 11 00:50:34 AEST 1991


In article <1991May8.233806.28719 at texrex.uucp> rmfowler at texrex.uucp (Rex Fowler) writes:
|I'm not 100% positive, but I believe at USENIX I heard that Oz's package
|is not compatible with dbm/ndmb/gdbm, just faster.  
|
|There are some other mini-dbm's around but I don't know anything about
|their functionality.  Maybe dbz from Henry Spencer's CNEWS will work.
|I didn't try to add dbm since I was having enough trouble already.

I think you got it backwards, or misinterpreted.

The dbz package is not a full dbm implementation, but just the
subset that it required for storing and looking up news-ids.

Sdbm, except for an early preliminary version, is compatible with
dbm and ndbm at the functional interface.  The only incompatibility
is that it uses a different (and faster) hashing function, so that
a program linked with sdbm cannot use the same file as a program
linked with dbm/ndbm.

I wrote a while ago a simple Perl script to dump or load a dbm
file using whatever dbm package you perl interpreter was linked
with.  So, if you build Perl twice, you can use that script to
convert from dbm format to sdbm format.  You might also use this
if you make use of the facility of defining your own hashing
function that Ozan provides (if you have some special application
that you are using sdbm for, you might be able to come up with a
hashing function that is customized to your specific keys to be
faster, smaller, or whatever).  You might also look into the
Berkely HASH package that Ozan has since developed with someone
from Berkely (hence the name).  I believe that it manages to remove
some of the limitations from *dbm - no maximum size for key+data,
no holes in the database file.  I haven't yet gotten a copy, but
expect to start using it shortly.
-- 
sendmail - as easy to operate and as painless as using        | John Macdonald
manually powered dental tools on yourself - John R. MacMillan |   jmm at eci386



More information about the Comp.sys.3b1 mailing list