dbm.ndbm.open()

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

Open a dbm database and return a ndbm object. The filename argument is the name of the database file (without the .dir or .pag extensions).

The optional flag argument must be one of these values:

Value Meaning
'r' Open existing database for reading only (default)
'w' Open existing database for reading and writing
'c' Open database for reading and writing, creating it if it doesn’t exist
'n' Always create a new, empty database, open for reading and writing

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).

In addition to the dictionary-like methods, ndbm objects provide the following method:

ndbm.close()

Close the ndbm database.

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

Please login to continue.