blob: 5928126440c7d15692f037d31123862fbfe5eac0 [file] [log] [blame]
Guido van Rossum571391b1997-04-03 22:41:49 +00001\section{Standard Module \sectcode{whichdb}}
Guido van Rossume47da0a1997-07-17 16:34:52 +00002\label{module-whichdb}
Guido van Rossum571391b1997-04-03 22:41:49 +00003\stmodindex{whichdb}
4
5The single function in this module attempts to guess which of the
6several simple database modules available--dbm, gdbm, or
7dbhash--should be used to open a given file.
8
Guido van Rossum571391b1997-04-03 22:41:49 +00009\begin{funcdesc}{whichdb}{filename}
10Returns one of the following values: \code{None} if the file can't be
11opened because it's unreadable or doesn't exist; the empty string
12(\code{""}) if the file's format can't be guessed; or a string
13containing the required module name, such as \code{"dbm"} or
14\code{"gdbm"}.
15\end{funcdesc}
16