Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!mauxci!eci386!jmm From: jmm@eci386.uucp (John Macdonald) Newsgroups: comp.sys.3b1 Subject: Re: perl4.003 and ndbm Message-ID: <1991May10.145034.7299@eci386.uucp> Date: 10 May 91 14:50:34 GMT References: <339@kyzyl.mi.org> <1991May8.233806.28719@texrex.uucp> Reply-To: jmm@eci386.UUCP (John Macdonald) Organization: Elegant Communications Inc. Lines: 36 In article <1991May8.233806.28719@texrex.uucp> rmfowler@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@eci386