MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / write

Method write

scripts/test-impact/coverage_live_v2.py:251–268  ·  view source on GitHub ↗
(self, relative, data)

Source from the content-addressed store, hash-verified

249 os.close(fd)
250
251 def write(self, relative, data):
252 self.check()
253 parent, name = os.path.split(relative)
254 fd = _directory(os.path.join(self.path, parent))
255 try:
256 target = os.open(name, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW,
257 0o600, dir_fd=fd)
258 try:
259 with os.fdopen(target, "wb") as stream:
260 stream.write(data)
261 stream.flush()
262 os.fsync(stream.fileno())
263 except BaseException:
264 # Partial evidence remains; no marker is created on this path.
265 raise
266 finally:
267 os.close(fd)
268 return os.path.join(self.path, relative)
269
270 def json(self, relative, value):
271 data = (json.dumps(value, sort_keys=True, indent=2,

Callers 15

jsonMethod · 0.95
collectFunction · 0.95
mainFunction · 0.45
append_logFunction · 0.45
publish_barrier_fileFunction · 0.45
record_resultFunction · 0.45
record_start_failureFunction · 0.45
generate_wrappersFunction · 0.45
emit_rangesFunction · 0.45
mainFunction · 0.45
write_binFunction · 0.45
write_tokens_txtFunction · 0.45

Calls 5

checkMethod · 0.95
_directoryFunction · 0.85
openMethod · 0.80
flushMethod · 0.80
closeMethod · 0.45

Tested by 5

append_logFunction · 0.36
publish_barrier_fileFunction · 0.36
record_resultFunction · 0.36
record_start_failureFunction · 0.36
sendFunction · 0.36