Module whichdb
[hide private]
[frames] | no frames]

Module whichdb

Guess which db package to use to open a db file.

Functions [hide private]
 
whichdb(filename)
Guess which db package to use to open a db file.

Imports: os, struct, sys, dbm, _dbmerror


Function Details [hide private]

whichdb(filename)

 
Guess which db package to use to open a db file.

Return values:

- None if the database file can't be read;
- empty string if the file can be read but can't be recognized
- the module name (e.g. "dbm" or "gdbm") if recognized.

Importing the given module may still fail, and opening the
database using that module may still fail.