On Tue, 8 Jun 2004, Dave Thomas wrote:
>
> On Jun 7, 2004, at 18:06, Yukihiro Matsumoto wrote:
>
> > Hi,
> >
> > In message "dbm/gdbm/sdbm etc"
> >     on 04/06/07, Dave Thomas <dave / pragprog.com> writes:
> >
> > |Does ext/dbm supersede gdbm and sdbm?
> >
> > No.  ext/dbm provides basic dbm API, using dbm-like library
> > (e.g. ndbm, gdbm) available on the platform.  sdbm comes with a
> > portable (but inefficient) version of dbm library.  gdbm is a wrapper
> > for gdbm library.
>
> To help readers make a choice: why should they select (say) gdbm over
> dbm using gdbm?
>

I insist that the file format used is important. If you want to
read/modify an existing DBM-database you don't want to get the
DBM-library that happens to be favoured by Ruby (just now).

The database may also be accessed by other applications (or another
version of Ruby), and in this case the current Ruby script have to
adapt to these external requirements.

Wouldn't it be better to have three libraries that explicitly are
targeted to the three formats Berkeley DB, GDBM and SDBM ?
And then another package (maybe still called "dbm") that chooses the
"best"  one available. That way a user can be explicit if he wants,
or let Ruby choose the best if that is what he wants.

I believe that is the way it is done in Perl. See:

    $ perldoc AnyDBM_File

/Johan Holmberg