Fred Drake | 295da24 | 1998-08-10 19:42:37 +0000 | [diff] [blame] | 1 | \section{\module{whichdb} --- |
| 2 | Guess which DBM-style module created a given database.} |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame] | 3 | \declaremodule{standard}{whichdb} |
| 4 | |
| 5 | \modulesynopsis{Guess which DBM-style module created a given database.} |
| 6 | |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 7 | |
| 8 | The single function in this module attempts to guess which of the |
| 9 | several simple database modules available--dbm, gdbm, or |
| 10 | dbhash--should be used to open a given file. |
| 11 | |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 12 | \begin{funcdesc}{whichdb}{filename} |
| 13 | Returns one of the following values: \code{None} if the file can't be |
| 14 | opened 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 |
| 16 | containing the required module name, such as \code{"dbm"} or |
| 17 | \code{"gdbm"}. |
| 18 | \end{funcdesc} |
| 19 | |