gdbm compatibility between linux and freebsd

Discussion in 'Python' started by bucket79, Aug 21, 2003.

  1. bucket79

    bucket79 Guest

    here's a problem
    A is redhatlinux and B is freebsd

    A)
    $uname -a
    Linux xxxxxxxxx 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown

    $python -V
    Python 2.2.2

    $ldd /usr/local/lib/python2.2/lib-dynload/gdbm.so
    libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x4000a000)
    libc.so.6 => /lib/i686/libc.so.6 (0x40011000)
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

    B)
    $uname -a
    FreeBSD xxx.xxx.xxx 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Mon Aug 18
    11:34:38 KST 2003 xxxxxxxxxxxxxxxxxxxxxx i386

    $python -V
    Python 2.2.3

    $ldd /usr/local/lib/python2.2/site-packages/gdbm.so
    libc_r.so.5 => /usr/lib/libkse.so.1 (0x2815e000)
    libgdbm.so.3 => /usr/local/lib/libgdbm.so.3 (0x28180000)

    and the problem is gdbm db file is not compatible between two system
    for example
    in system A)
    >>import gdbm
    >>f = gdbm.open("test.db", "c")
    >>f["1"] = "first"
    >>f.close()

    and copy this file to freebsd system and try to open this file then it
    fails !!
    like this
    in system B)
    >>import gdbm
    >>f = gdbm.open("test.db", "r")

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    gdbm.error: File read error

    and reverse case is also fails. more precisely say in this case python
    occurs gdbm FATAL error :(

    anyone know what is the casuse of this problem?
     
    bucket79, Aug 21, 2003
    #1
    1. Advertising

  2. bucket79

    Arne Koewing Guest

    (bucket79) writes:

    > here's a problem

    ....
    > and the problem is gdbm db file is not compatible between two system
    > for example

    ....
    > anyone know what is the casuse of this problem?

    Yes and No ;-)

    I do not think that gdbm-files could be considered 'portable'
    (gdbm surely is, the files are (sometimes) not)

    on freebsd systems `off_t` is (sometimes) 8 bytes, while on most
    others it's just 4 bytes.

    try changing off_t" to "loff_t" in gdbmdefs.h and recompile libgdmb
    (breaking existing databases on the system !!!! )

    or use some other format for interchanging information.

    some people say bdb is not that problematic but I don't know...
    (I'll treat all *db databases non-portable)
    bdb databases can be be dumped to some interchangeable format.


    Arne
    --
     
    Arne Koewing, Aug 21, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles Prince
    Replies:
    0
    Views:
    346
    Charles Prince
    Dec 6, 2004
  2. JAG

    GDBM and Perl 5.6.1

    JAG, Feb 12, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    228
    Joe Smith
    Feb 13, 2004
  3. Jim Pazarena

    perl and GDBM and FreeBSD

    Jim Pazarena, Feb 8, 2005, in forum: Perl Misc
    Replies:
    0
    Views:
    226
    Jim Pazarena
    Feb 8, 2005
  4. PerlFAQ Server
    Replies:
    0
    Views:
    137
    PerlFAQ Server
    Feb 3, 2011
  5. PerlFAQ Server
    Replies:
    0
    Views:
    131
    PerlFAQ Server
    Feb 22, 2011
Loading...

Share This Page