MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / write_text_atomic

Function write_text_atomic

graphify/paths.py:255–257  ·  view source on GitHub ↗

Atomically write ``text`` (UTF-8) to ``path``. See :func:`_atomic_replace`.

(path: "str | Path", text: str)

Source from the content-addressed store, hash-verified

253
254
255def write_text_atomic(path: "str | Path", text: str) -> None:
256 """Atomically write ``text`` (UTF-8) to ``path``. See :func:`_atomic_replace`."""
257 _atomic_replace(path, lambda f: f.write(text))
258
259
260def write_text_atomic_if_changed(path: "str | Path", text: str) -> bool:

Calls 2

_atomic_replaceFunction · 0.85
writeMethod · 0.80