Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: DBM Portability?

by Anonymous Monk
on Oct 03, 2002 at 11:30 UTC ( #202478=note: print w/replies, xml ) Need Help??

in reply to DBM Portability?

Your problem is that you are using dbmopen. It uses the first of several possible local dbm implementations. Which means that going from one machine to another its file format does not remain the same. It also means that on a single machine if you install a better dbm implementation, the file format it uses can change on you, causing loss of data.

And no, I have no idea why there aren't BIG RED WARNINGS everywhere about this pitfall.

Replies are listed 'Best First'.
Re: Re: DBM Portability?
by Anonymous Monk on Oct 03, 2002 at 12:43 UTC
    So if I don't want to go through the hassle of recreating DBMs when I copy from one computer to another, and if possible, not to worry about checking versions on all of my computers to make sure they're the same, and I don't want to hassle with using dd or cpio, what options to I have?
      1. Make sure you are using the same format on each machine. You could use tie %hash, DB_File, 'file'; which specifies which DB type you want to use explicitly (unless you use AnyDBM_File :). Also, dbmopen has been deprecated since Perl 5.
      2. Try compressing the data file and then transferring, or, if there's more than one, compress all of them first, and then tar them together.

      What time is it? It's Camel Time!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://202478]
[shmem]: but! perl4 doesn't suck.
[LanX]: better try 3
[shmem]: that python stuff is none of my business.
[shmem]: but sometimes I have to debug things implemeted by "the other team" and stick their nose into their dirt.
[shmem]: because it affects "my team"
[shmem]: ah well... git is incomplete. There are commands missing:
[shmem]: git stop crap

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2018-03-20 18:35 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (257 votes). Check out past polls.