>>> import dbm
>>> x = dbm.open('XXX','rw',0644)
>>> len(x)
0
>>>
darwin 5 % ll
total 44
drwxr-xr-x 2 friedric 512 Mar 30 07:15 ./
drwxr-xr-x 7 friedric 1024 Mar 29 17:14 ../
-rw-r--r-- 1 friedric 4096 Mar 29 17:14 Notebase.dir
-rw-r--r-- 1 friedric 16384 Mar 29 17:14 Notebase.pag
-rw-r--r-- 1 friedric 16384 Mar 30 07:15 XXX.db
...
The BSD ndbm implementation is not backwards compatible with the
file format of the original ndbm implemetations. Breaking
compatiblity was necessary in order to fix the string length
limitations of ndbm. I haven't tested build the original dbm
module with the dbhash module. I think it should be possible, but you
may have to delete the ndbm function calls from the libdb.a archive so
they aren't found in the standard library and the new BSD library at
link time.
Michael