Next: termios Prev: dbm Up: UNIX Specific Services Top: Top
gdbmgdbm
database library. Gdbm objects are of the mapping type, so they can be
handled just like objects of the built-in 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:
KeyError is
raised for general mapping errors like specifying an incorrect key.
'r', 'w',
'c', or 'n' for reader, writer (this also gives read
access), create (writer, but create the database if it doesn't 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 cannot open the gdbm file at the same time. Note that the
GDBM_FAST mode of opening the database is not supported.
filemode is the UNIX mode of the file, used only when a
database is created (but to be supplied at all times).