blob: 5c698183fc6e9657f14ef6b9fc390605cd4391cb [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001
2:mod:`whichdb` --- Guess which DBM module created a database
3============================================================
4
5.. module:: whichdb
6 :synopsis: Guess which DBM-style module created a given database.
7
8
9The single function in this module attempts to guess which of the several simple
10database modules available--\ :mod:`dbm`, :mod:`gdbm`, or :mod:`dbhash`\
11--should be used to open a given file.
12
13
14.. function:: whichdb(filename)
15
16 Returns one of the following values: ``None`` if the file can't be opened
17 because it's unreadable or doesn't exist; the empty string (``''``) if the
18 file's format can't be guessed; or a string containing the required module name,
19 such as ``'dbm'`` or ``'gdbm'``.
20