Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: Problems with ndbm Message-ID: <18904@mimsy.UUCP> Date: 4 Aug 89 22:17:29 GMT References: <34200002@zaphod> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 16 In article <34200002@zaphod> doug@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@mimsy.umd.edu Path: uunet!mimsy!chris