[Spambayes] Find which db is used by pop3proxy

Skip Montanaro skip at pobox.com
Fri Jul 11 09:59:53 EDT 2003


    Remi> If I'm using dumbdbm should I switch to bsddb3 or PyBSDDB

Yes, I think so.

    Remi> Is there a simple way to find out which db is used ?

Yes.  Here's a short interactive session which shows how to use the whichdb
module to identify the module which should be used to open an existing db
file.  First it creates a dumbdbm file, then uses whichdb to detect it, an
existing hammie db file and a nonexistent file.

    >>> import dumbdbm
    >>> db = dumbdbm.open("dumbdb", "c")
    >>> db["1"] = "1"
    >>> db.close()
    >>> import whichdb
    >>> whichdb.whichdb("dumbdb")
    'dumbdbm'
    >>> whichdb.whichdb("hammie.db")
    'dbhash'
    >>> whichdb.whichdb("nonexistent.db")
    >>> 

Skip



More information about the Spambayes mailing list