dbm.dumb.open()

dbm.dumb.open(filename[, flag[, mode]])

Open a dumbdbm database and return a dumbdbm object. The filename argument is the basename of the database file (without any specific extensions). When a dumbdbm database is created, files with .dat and .dir extensions are created.

The optional flag argument supports only the semantics of 'c' and 'n' values. Other values will default to database being 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 0o666 (and will be modified by the prevailing umask).

Changed in version 3.5: open() always creates a new database when the flag has the value 'n'.

In addition to the methods provided by the collections.abc.MutableMapping class, dumbdbm objects provide the following methods:

dumbdbm.sync()

Synchronize the on-disk directory and data files. This method is called by the Shelve.sync() method.

dumbdbm.close()

Close the dumbdbm database.

doc_python
2016-10-07 17:31:06
Comments
Leave a Comment

Please login to continue.