Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

using indexed (dbm) files

by pme (Pilgrim)
on Jan 30, 2004 at 09:59 UTC ( #325190=perlquestion: print w/ replies, xml ) Need Help??
pme has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I'd like to use the indexed (dbm) files from both Perl and C. The file is generated from Perl and read by program written in C. I'm totally confused by the file formats (ndbm, gdbm, Berkeley DB etc.). What format should I use? On Debian 3.0r2 there is man page for dbopen, but the db.h contains the db_create() only. I'd like to avoid installing new libraraies. Thanks in advance

Comment on using indexed (dbm) files
Re: using indexed (dbm) files
by Abigail-II (Bishop) on Jan 30, 2004 at 10:35 UTC
    Use whatever format you have support for.

    Abigail

Re: using indexed (dbm) files
by DrHyde (Prior) on Jan 30, 2004 at 12:23 UTC
    There's a nice feature comparison table here.
      Thanks, I've bookmarked it!
Re: using indexed (dbm) files
by RandomWalk (Beadle) on Jan 30, 2004 at 16:45 UTC
    From "Learning Perl": you might also check your AnyDBM_file manpage and/or you might want to download the "which_dbm" utility from

    http://examples.oreilly.com/lperl/3rd_edition_examples/

    The latter diagnoses which db you've already got.

      Thanks, I'll try it.
Re: using indexed (dbm) files
by Anonymous Monk on Jan 30, 2004 at 23:40 UTC
    remember that C requires null terminated strings while perl does not.
Re: using indexed (dbm) files
by scottj (Monk) on Jan 31, 2004 at 10:13 UTC
    I have done this in the past with Berkeley DB and had much success.

    I had a CGI written in C (way back in the day) that would write to the Berkeley DB. Then my perl script would come along every so often and yank the data out of the Berkeley DB for processing.

    I don't have a lot of experience with the other options you listed, but Berkeley DB is a very robust system that will probably handle just about anything you need it for. And the folks at Sleepycat are great, too. :)
Re: using indexed (dbm) files
by astroboy (Chaplain) on Feb 02, 2004 at 12:41 UTC
    Came across this site a couple of weeks ago. They do a pretty good job of looking at the various DBMS's and supply sample code, etc

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://325190]
Approved by b10m
Front-paged by DrHyde
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-09-19 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls