tobold.org

correct • elegant • free

△ comp.lang.perl △

◅ GDBM_File barfs on NFS mounted disk

Piping array contents to a system command ▻

GDBM_File barfs on NFS mounted disk

In article <4b4alt$ak4@nntp1.u.washington.edu>,
Chris Abajian  <couloir@u.washington.edu> wrote:
>The issue right now is that since I run on three platforms, I need
>more than one copy of the database.  NDBM is byte-order dependent,
>which means that the alpha files are different than the hp files,
>etc.  So I maintain multiple copies.  Ick.  Rumor has it that
>the berzerkeley routines don't have this problem.

After the briefest of glances at the man pages and source, this
seems to be the case.  Each of the three types of database (btree,
hash, and recno) includes a `lorder' element in its `openinfo'
struct, and will arrange to swap bytes of the metadata if necessary.
(Only big-endian and little-endian options are implemented, so PDP 11
owners lose. :-)

Obviously (?) it's your responsibility to ensure that the data you
store is portable between architectures.  If you store raw ints,
floats, structs, etc. in the database don't expect to read them
successfully on a different machine (or even the same machine with
a different OS or compiler).

>                          Do you have a pointer to these routines
>that might be readily compiled on different platforms?

ftp://ftp.cs.berkeley.edu/ucb/4bsd/db.1.85.tar.{Z,gz}

>                                                        Do you think
>I can safely build just one copy for all three platforms (sun, hp, alpha)?

One copy of the db library?  Of course not.

One copy of the database?  It would seem so.  I've not tried sharing
database between architectures...

Tim.
--
Tim Goodwin   | "Repeat after me: naming and addressing are
Unipalm PIPEX | completely independent." -- Barry Margolin

Original headers:

From: tim@pipex.net (Tim Goodwin)
Newsgroups: gnu.misc.discuss
Subject: Re: GDBM_File barfs on NFS mounted disk
Date: 20 Dec 1995 18:11:30 GMT
Organization: Unipalm PIPEX
Message-ID: <4b9jki$9uf@wave.news.pipex.net>
References: <4aq2pu$8rr@nntp1.u.washington.edu>
  <4ascpm$62a@wave.news.pipex.net> <4b4alt$ak4@nntp1.u.washington.edu>

△ comp.lang.perl △

◅ GDBM_File barfs on NFS mounted disk

Piping array contents to a system command ▻