I'm attempting to recover data from a trashed website; I believe the .pag & .dir files that are its databases are intact, but they came from a rather musty BSDI 2.x system. They were evidently created with old-fashioned dbmopen(). Moving the files to a BSDI 4.0.1 system has eliminated the "file too large" errors, but now trying to print them results in nothing at all. I'm using this wee script:

#!/usr/bin/perl5 -w dbmopen(%db, 'member.dir', 0644) or die "Can't open member: $!\n"; foreach $i (keys %db) { print "$i ==> $db{$i}\n"; }

It seems to make little difference whether I put in 'member', 'member.pag', or 'member.dir', as above. The script doesn't die, but neither does it print anything out. Trying to use DB_File and NDBM_File more directly doesn't seem to have panned out. A 'file member.dir' says this is an NDBM 1.x or GDBM file, and being on BSDI, I suspect it's probably NDBM. I've been unable to get GDBM_File working on the new system, though it appears to have gdbm installed. I'm going to pursue that tack a bit now, but thought I would post here and check back now and again to see if I'm being thoroughly stupid. Is there any hope?

--TQuid


In reply to .pag and .dir - what db format?? by TQuid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.