[comp.unix.questions] data base manager

gaur@uicsrd.UUCP (06/17/87)

	Hi! In the unix manual there is a data base manager provided
in the miscellaneous library functions. DBM(3X)

	It seems that we cannot close a database and open an another one
in a program. Is it true?
thanks,
yogesh
(gaur%uicsrd@a.cs.uiuc.edu)

chris@mimsy.UUCP (Chris Torek) (06/20/87)

In article <45000008@uicsrd> gaur@uicsrd.CSRD.UIUC.EDU writes:
>DBM(3X) ... we cannot close a database and open an another one
>in a program. Is it true?

This is indeed true.  If you have dbm, you are probably running
4BSD; if you are running 4BSD, you are probably running either 4.2BSD
or 4.3BSD.  If the former, you can switch to 4.3BSD; if the latter,
or after switching, see man 3x ndbm.

Incidentally, with old dbm, this works after a fashion:

	dbmclose()
	{
		extern int dirf, pagf;
		extern long dblkno, pblkno;

		(void) close(dirf);
		(void) close(pagf);
		dirf = pagf = -1;
		dblkno = pblkno = -1;
	}

if I got the names right (I am working entirely from memory).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)
Domain:	chris@mimsy.umd.edu	Path:	seismo!mimsy!chris