blob: 06b9934f42b76fd5bcbb87d26d0f1e79b2a10d86 [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{whichdb} ---
Fred Drakebbac4321999-02-20 00:14:17 +00002 Guess which DBM module created a database}
Fred Drakeb91e9341998-07-23 17:59:49 +00003
Fred Drakebbac4321999-02-20 00:14:17 +00004\declaremodule{standard}{whichdb}
Fred Drakeb91e9341998-07-23 17:59:49 +00005\modulesynopsis{Guess which DBM-style module created a given database.}
6
Guido van Rossum571391b1997-04-03 22:41:49 +00007
8The single function in this module attempts to guess which of the
9several simple database modules available--dbm, gdbm, or
10dbhash--should be used to open a given file.
11
Guido van Rossum571391b1997-04-03 22:41:49 +000012\begin{funcdesc}{whichdb}{filename}
13Returns one of the following values: \code{None} if the file can't be
14opened because it's unreadable or doesn't exist; the empty string
15(\code{""}) if the file's format can't be guessed; or a string
16containing the required module name, such as \code{"dbm"} or
17\code{"gdbm"}.
18\end{funcdesc}
19