I am attempting to open a *.bdb file using python package: bsddb
. I have confirmed the file is a Berkeley DB (Btree, version 9) by using file command in Linux.
However, when I attempt to open using the following script in Python:
db2 = bsddb.btopen('FeatureVector.bdb')
I get the error BDB0590: files containing multiple databases may only be opened read-only.
I attempted to open as read-only by adding a r
flag, and it opens, but when I try to iterate through all values, only one key is returned without a value.
Any ideas?
Here is the code in full
import bsddb
db2 = bsddb.btopen('FeatureVector.bdb')
for k, v in db2.iteritems():
print k, v
And it is returning:
FeatureVector
, which is the name of the file. I guess a follow-up question is how do I view the different databases inside of the file?