summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libgdbm.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-08 08:03:24 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-08 08:03:24 (GMT)
commitb69e0958a5fee76bbaaaf606997dc19cd4b33406 (patch)
tree84309f1f9877c746502b6aeae8834ab02df845ef /Doc/lib/libgdbm.tex
parente06752b4570012021d3b90cb96bdd93ab8c072d8 (diff)
downloadcpython-b69e0958a5fee76bbaaaf606997dc19cd4b33406.zip
cpython-b69e0958a5fee76bbaaaf606997dc19cd4b33406.tar.gz
cpython-b69e0958a5fee76bbaaaf606997dc19cd4b33406.tar.bz2
Added gdbm docs
Diffstat (limited to 'Doc/lib/libgdbm.tex')
-rw-r--r--Doc/lib/libgdbm.tex30
1 files changed, 30 insertions, 0 deletions
diff --git a/Doc/lib/libgdbm.tex b/Doc/lib/libgdbm.tex
new file mode 100644
index 0000000..40facad
--- /dev/null
+++ b/Doc/lib/libgdbm.tex
@@ -0,0 +1,30 @@
+\section{Built-in Module \sectcode{gdbm}}
+\bimodindex{gdbm}
+
+Gdbm provides python programs with an interface to the GNU \code{gdbm}
+database library. Gdbm objects are of the mapping type, so they can be
+handled just like objects of the built-in \dfn{dictionary} type,
+except that keys and values are always strings, and printing a gdbm
+object doesn't print the keys and values.
+
+The module is based on the Dbm module, modified to use GDBM instead.
+
+The module defines the following constant and functions:
+
+\renewcommand{\indexsubitem}{(in module gdbm)}
+\begin{excdesc}{error}
+Raised on gdbm-specific errors, such as I/O errors. \code{KeyError} is
+raised for general mapping errors like specifying an incorrect key.
+\end{excdesc}
+
+\begin{funcdesc}{open}{filename\, rwmode\, filemode}
+Open a gdbm database and return a mapping object. \var{filename} is
+the name of the database file, \var{rwmode} is \code{'r'}, \code{'w'},
+\code{'c'}, or \code{'n'} for reader, writer (this also gives read
+access), create (writer, but create the database if it doesnt already
+exist) and newdb (which will always create a new database). Only one
+writer may open a gdbm file and many readers may open the file. Readers
+and writers can not open the gdbm file at the same time. Note that the
+\code{GDBM_FAST} mode of opening the database is not supported. \var{filemode}
+is the unix mode of the file, used only when a database is created.
+\end{funcdesc}