Fred Drake | 3a0351c | 1998-04-04 07:23:21 +0000 | [diff] [blame] | 1 | \section{Standard Module \module{whichdb}} |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame] | 2 | \declaremodule{standard}{whichdb} |
| 3 | |
| 4 | \modulesynopsis{Guess which DBM-style module created a given database.} |
| 5 | |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 6 | |
| 7 | The single function in this module attempts to guess which of the |
| 8 | several simple database modules available--dbm, gdbm, or |
| 9 | dbhash--should be used to open a given file. |
| 10 | |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 11 | \begin{funcdesc}{whichdb}{filename} |
| 12 | Returns one of the following values: \code{None} if the file can't be |
| 13 | opened because it's unreadable or doesn't exist; the empty string |
| 14 | (\code{""}) if the file's format can't be guessed; or a string |
| 15 | containing the required module name, such as \code{"dbm"} or |
| 16 | \code{"gdbm"}. |
| 17 | \end{funcdesc} |
| 18 | |