MCPcopy Create free account
hub / github.com/RustPython/RustPython / _create

Method _create

Lib/dbm/dumb.py:74–90  ·  view source on GitHub ↗
(self, flag)

Source from the content-addressed store, hash-verified

72 self._update(flag)
73
74 def _create(self, flag):
75 if flag == 'n':
76 for filename in (self._datfile, self._bakfile, self._dirfile):
77 try:
78 _os.remove(filename)
79 except OSError:
80 pass
81 # Mod by Jack: create data file if needed
82 try:
83 f = _io.open(self._datfile, 'r', encoding="Latin-1")
84 except OSError:
85 if flag not in ('c', 'n'):
86 raise
87 with _io.open(self._datfile, 'w', encoding="Latin-1") as f:
88 self._chmod(self._datfile)
89 else:
90 f.close()
91
92 # Read directory file into the in-memory index dict.
93 def _update(self, flag):

Callers 1

__init__Method · 0.95

Calls 4

_chmodMethod · 0.95
removeMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected