summaryrefslogtreecommitdiff
path: root/sys/src/cmd/python/Doc/lib/libdbm.tex
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-05-03 11:25:13 +0000
commit458120dd40db6b4df55a4e96b650e16798ef06a0 (patch)
tree8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Doc/lib/libdbm.tex
parent3a742c699f6806c1145aea5149bf15de15a0afd7 (diff)
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Doc/lib/libdbm.tex')
-rw-r--r--sys/src/cmd/python/Doc/lib/libdbm.tex61
1 files changed, 61 insertions, 0 deletions
diff --git a/sys/src/cmd/python/Doc/lib/libdbm.tex b/sys/src/cmd/python/Doc/lib/libdbm.tex
new file mode 100644
index 000000000..e08af9989
--- /dev/null
+++ b/sys/src/cmd/python/Doc/lib/libdbm.tex
@@ -0,0 +1,61 @@
+\section{\module{dbm} ---
+ Simple ``database'' interface}
+
+\declaremodule{builtin}{dbm}
+ \platform{Unix}
+\modulesynopsis{The standard ``database'' interface, based on ndbm.}
+
+
+The \module{dbm} module provides an interface to the \UNIX{}
+(\code{n})\code{dbm} library. Dbm objects behave like mappings
+(dictionaries), except that keys and values are always strings.
+Printing a dbm object doesn't print the keys and values, and the
+\method{items()} and \method{values()} methods are not supported.
+
+This module can be used with the ``classic'' ndbm interface, the BSD
+DB compatibility interface, or the GNU GDBM compatibility interface.
+On \UNIX, the \program{configure} script will attempt to locate the
+appropriate header file to simplify building this module.
+
+The module defines the following:
+
+\begin{excdesc}{error}
+Raised on dbm-specific errors, such as I/O errors.
+\exception{KeyError} is raised for general mapping errors like
+specifying an incorrect key.
+\end{excdesc}
+
+\begin{datadesc}{library}
+Name of the \code{ndbm} implementation library used.
+\end{datadesc}
+
+\begin{funcdesc}{open}{filename\optional{, flag\optional{, mode}}}
+Open a dbm database and return a dbm object. The \var{filename}
+argument is the name of the database file (without the \file{.dir} or
+\file{.pag} extensions; note that the BSD DB implementation of the
+interface will append the extension \file{.db} and only create one
+file).
+
+The optional \var{flag} argument must be one of these values:
+
+\begin{tableii}{c|l}{code}{Value}{Meaning}
+ \lineii{'r'}{Open existing database for reading only (default)}
+ \lineii{'w'}{Open existing database for reading and writing}
+ \lineii{'c'}{Open database for reading and writing, creating it if
+ it doesn't exist}
+ \lineii{'n'}{Always create a new, empty database, open for reading
+ and writing}
+\end{tableii}
+
+The optional \var{mode} argument is the \UNIX{} mode of the file, used
+only when the database has to be created. It defaults to octal
+\code{0666}.
+\end{funcdesc}
+
+
+\begin{seealso}
+ \seemodule{anydbm}{Generic interface to \code{dbm}-style databases.}
+ \seemodule{gdbm}{Similar interface to the GNU GDBM library.}
+ \seemodule{whichdb}{Utility module used to determine the type of an
+ existing database.}
+\end{seealso}