[comp.unix.questions] dbm docs?

pete@othello.dartmouth.edu (Pete Schmitt) (05/19/91)

I'm looking for any docs (beyond the man page) for dbm.  The information
I'm looking for is how the data is stored in both the .dir and .pag files
and how they are used together internally.

-pete schmitt
--
     Peter Schmitt                                          UNIX Consultant
Kiewit Computation Center                                Computing  Services
   Dartmouth College                                         (603)646-2085
   Hanover, NH 03755                                 Peter.Schmitt@Dartmouth.EDU

oz@ursa.ccs.yorku.ca (Ozan Yigit) (05/23/91)

pete@othello.dartmouth.edu (Pete Schmitt) writes:

   I'm looking for any docs (beyond the man page) for dbm.  The information
   I'm looking for is how the data is stored in both the .dir and .pag files
   and how they are used together internally.

You can find out about the exact details of dbm/ndbm's page file format in
the sdbm implementation, as sdbm uses the very same format of dbm/ndbm.
Sdbm also comes with a few trivial utilities to work with the page files
alone, ignoring the dir file. The dir file format is simple: it is an
array of bits, and the algorithm to generate those bits is different for
sdbm and ndbm. To put it simply, it is the split history of the page file,
and any attempt to utilize it must have the same generation algorithm and
the same hash function as the database library.

Everything else you might want to know about dbm-style external hashing
algorithms is detailed in [1], ftpable from nexus.yorku.ca under pub/oz
as hash.ps.Z.

If you need a very nice and fast hashing package with full dbm/ndbm
capabilities, you should get the berkeley hash package, ftpable from
postgres.berkeley.edu as bsd_db.tar.Z. This package includes a btree
library as well.

oz
---
[1] Seltzer and Yigit, A New Hash Package for UNIX,
    Proceedings of the USENIX Technical Conference, Dallas, Texas.
    January 1991, 173-184
---
Not all good things come with three	 | internet: oz@nexus.yorku.ca
pages of dogma and an attitude. - anon   | uucp: utzoo/utai!yunexus!oz

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) (05/26/91)

In article <OZ.91May23114335@ursa.ccs.yorku.ca> oz@ursa.ccs.yorku.ca (Ozan Yigit) writes:
> If you need a very nice and fast hashing package with full dbm/ndbm
> capabilities, you should get the berkeley hash package, ftpable from
> postgres.berkeley.edu as bsd_db.tar.Z. This package includes a btree
> library as well.

Yeah. This package makes entire mobs of VMS users shut up about the lack
of standard UNIX file formats. With any luck it'll be available in most
UNIX systems in five years.

---Dan

jfh@rpp386.cactus.org (John F Haugh II) (05/27/91)

In article <12177:May2521:45:5991@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
>In article <OZ.91May23114335@ursa.ccs.yorku.ca> oz@ursa.ccs.yorku.ca (Ozan Yigit) writes:
>> If you need a very nice and fast hashing package with full dbm/ndbm
>> capabilities, you should get the berkeley hash package, ftpable from
>> postgres.berkeley.edu as bsd_db.tar.Z. This package includes a btree
>> library as well.
>
>Yeah. This package makes entire mobs of VMS users shut up about the lack
>of standard UNIX file formats. With any luck it'll be available in most
>UNIX systems in five years.

If we could get some kind soul to re-post the sources to a newsgroup
near you, it would probably be out there a bit faster.  Without the
full directory pathname, it isn't possible even to get it with BITFTP
or whatever.
-- 
John F. Haugh II        | Distribution to  | UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 255-8251 | GEnie PROHIBITED :-) |  Domain: jfh@rpp386.cactus.org
"If liberals interpreted the 2nd Amendment the same way they interpret the
 rest of the Constitution, gun ownership would be mandatory."

adrianho@barkley.berkeley.edu (Adrian J Ho) (05/29/91)

In article <19336@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes:
>If we could get some kind soul to re-post the sources to a newsgroup
>near you, it would probably be out there a bit faster.  Without the
>full directory pathname, it isn't possible even to get it with BITFTP
>or whatever.

	postgres.berkeley.edu:/pub/bsd_db.tar.Z [128.32.149.1]

--
-----------------------------------------------------------------------------
Adrian Ho, EECS (pronounced "eeks!") Dept.		Phone: (415) 642-5563
UC Berkeley					adrianho@barkley.berkeley.edu

frk@scrap.sybase.com (frank korzeniewski) (05/30/91)

In article <19336@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes:
	[stuff about package available thru ftp]
#
#If we could get some kind soul to re-post the sources to a newsgroup
#near you, it would probably be out there a bit faster.  Without the
#full directory pathname, it isn't possible even to get it with BITFTP
#or whatever.

well, you can always send a request to BITFTP to do a "dir" then
more requests to do "cd blah" and a "dir".  it can take several attempts,
but it really is doable.

#-- 
#John F. Haugh II        | Distribution to  | UUCP: ...!cs.utexas.edu!rpp386!jfh
#Ma Bell: (512) 255-8251 | GEnie PROHIBITED :-) |  Domain: jfh@rpp386.cactus.org
#"If liberals interpreted the 2nd Amendment the same way they interpret the
# rest of the Constitution, gun ownership would be mandatory."

frk@sybase.com

ecs58365@zach.fit.edu ( BOWMASTER JR) (06/02/91)

  I am writing a utility FTPDIR, which will recursively search ftp
directories for a pattern name, since most ftp's don't support an 
ls -R or a grep. To do this, I am running an ftp as a child under my main
program, and communicating with the child via pipes. I have redirected 
stdin and stdout to my pipe, and set them as unbufferd using the setbuf
command. This works for the child, but as soon as I exec (or system, or
popen) ftp, the stdout gets set back to block buffered. I have tried using
popen on ftp and then using setbuf(stdout,NULL), but it still will not work.
(I know that the pipe is working, and that it's a buffering problem, since
I do get a responsafter I've sent 'verbose' to the child ftp about 2000 
times). I also tried to do a setlinebuf(stdout), but my version of C gives
a link error (unix C on a Harris HCX-9). If anyone knows how I can set 
the stdout to line buffered or unbuffered and have it stay that way when
I call ftp, I would be much happy if they could please clue me in.

                                               Thanx, James Bowmaster
                                               Florida Institute of Technology
					       ecs58365@zach.fit.edu