PyDocs

Nav

Data Persistence

open

dbm.dumb

function (source)
  • open(filename, flag='c', mode=0o666)
Open the database file, filename, and return corresponding object.

The flag argument, used to control how the database is opened in the
other DBM implementations, supports only the semantics of 'c' and 'n'
values.  Other values will default to the semantics of 'c' value:
the database will always opened for update and will be created if it
does not exist.

The optional mode argument is the UNIX mode of the file, used only when
the database has to be created.  It defaults to octal code 0o666 (and
will be modified by the prevailing umask).
Changed in 3.5, 3.8, 3.11
  • 3.5: open() always creates a new database when flag is 'n'.
  • 3.8: A database opened read-only if flag is 'r'. A database is not created if it does not exist if flag is 'r' or 'w'.
  • 3.11: filename accepts a path-like object.
0 Examples
No examples for dbm.dumb/open.
See Also
No see-alsos for dbm.dumb/open
0 Notes
No notes for open