MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / append_file

Function append_file

utils/file_utils.py:25–32  ·  view source on GitHub ↗
(path: str, content: str)

Source from the content-addressed store, hash-verified

23 return f"[ERROR] Could not write {path}: {e}"
24
25def append_file(path: str, content: str) -> str:
26 try:
27 p = Path(path).expanduser().resolve()
28 with open(p, "a", encoding="utf-8") as f:
29 f.write(content)
30 return f"Appended {len(content)} chars to {p}"
31 except Exception as e:
32 return f"[ERROR] {e}"
33
34def list_dir(path: str = ".") -> str:
35 """List directory contents."""

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected