GDBM on different platforms?

GDBM on different platforms?

Post by Andrew Zhilenk » Thu, 01 Apr 1999 04:00:00



Hello!

I need to generate on SGI IRIX machines GDBM files, which later
will be used on x86 FreeBSD computers. Now at FreeBSD when trying
to open this files, it gives an error (little-endian/big endian
conflict?)... How can I overcome it?

WBR, Andrew
--
 Andrew Zhilenko - Database Administrator
             Telenor Internet
tel.+42-02-96159436    fax. +42-02-96159422

Vaclavske namesti 4 - Praha 1 - 110 00
            Czech Republic

 
 
 

GDBM on different platforms?

Post by Zeni » Thu, 01 Apr 1999 04:00:00



: I need to generate on SGI IRIX machines GDBM files, which later will be
: used on x86 FreeBSD computers. Now at FreeBSD when trying to open this
: files, it gives an error (little-endian/big endian conflict?)... How can I
: overcome it?

        You can't.  AFAIK, the only DBM library that is byte order
        independent is Berkeley DB.

        So you have two choices.  You can use Berkeley DB in place of GDBM,
        which may or may not be easy to do.  Or you can convert the files.

        If you wish to convert the files, the easiest way is likely to
        install perl with GDBM and Berkeley DB support on both systems.
        Use perl to convert the GDBM to DB on the IRIX machine, transfer
        the files, then use perl again to convert it back to GDBM.

        Here's the perl code:

        gdbm_to_db gdbm_file_name db_file_file_name

        #!/usr/local/bin/perl -w

        use strict;
        use Fcntl;
        use GDBM_File;
        use DB_File;


        tie my %GDBM, 'GDBM_File', $gdbm, O_RDWR
            or die "gdbm open: $!";
        tie my %DB,   'DB_File', $db, O_RDWR|O_CREAT, 0666, $DB_HASH
            or die "db open: $!";

        while (my ($key, $val) = each %GDBM) {
            $DB{$key} = $val;
        }

        __END__

        Do the reverse to go the other way.

--

        Yah, Emacs is a good OS, but I prefer FreeBSD.

 
 
 

1. I need access to a number of different Unix platforms

I'm looking for a vendor (or vendors) that provide access to the Internet
through a number of different Unix Platforms. I've got a product which I
would like to make available under different hardware and software.  It
currently runs under Solaris on a Sparc machine.  Ideally, I'd like to find
just one vendor where I could compile the program on a number of target
machines.  However, multiple vendors may be acceptable if I can't find
just one.  The following environment is necessary for me to sign-on:

Access to a gcc compiler
Internet access that allows a home page with cgi-bin access
Access to the system through FTP and Telnet
Local dial-in access would be nice, but not absolutely necessary

So, is there anybody out there that offers access on a platform other
than Sparc/Solaris?  If so, pls email me with info...   THANX!

/--------------------------------------------------------------------\
|   A man said to the Universe: "Sir, I exist!"                      |
|   "However," replied the Universe,                                 |
|   "the fact has not created in me a sense of obligation."          |
|                                -- Stephen Crane                    |
\--------------------------------------------------------------------/    

Visit my home page at:

<A HREF="http://www.clark.net/pub/alweiner/cgi-bin/homepage.html">Alan's home page</A>


2. DPT PM3334/UW Hangs

3. running linux on different platforms?

4. Automounter problem between Netware 3.1x and Solaris 2.5

5. Where can I find access to a # of different platforms?

6. IPTABLES need clarity

7. Compile for a different Platform (Pentium to 486)

8. IPTABLES Flushing PREOUTING

9. make on different platforms?

10. Same .profile, .kshrc for many different Platforms?

11. Identifying different Solaris releases and platforms

12. Dynamic loading on different UN*X platforms ?

13. link between two different platforms ????