Problems with ndbm

Chris Torek chris at mimsy.UUCP
Sat Aug 5 08:17:29 AEST 1989


In article <34200002 at zaphod> doug at zaphod.prime.com writes:
>I have a general question about ndbm.  It seems that if you fetch the same
>data record twice you get null data.  This seems like faulty behavior.

It would be, but this does not happen on any machine on which we have
seen ndbm used (VAX, Tahoe, Sun 2, Sun 3, Sun 4, DECstation 3100, etc).

What does happen is that data stored by store() can come back in
different places in memory from different fetch() operations, and
that the dptr value returned by fetch points into a private buffer
that is overwritten by further calls to fetch() and other operations.
You must copy the data out of this private buffer if you want them
to hang around across calls.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list