MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / atomic_write

Function atomic_write

codeclash/utils/atomic_write.py:4–8  ·  view source on GitHub ↗

Write text to file atomically to prevent corruption on interruption.

(path: Path, text: str)

Source from the content-addressed store, hash-verified

2
3
4def atomic_write(path: Path, text: str) -> None:
5 """Write text to file atomically to prevent corruption on interruption."""
6 tmp_file = path.with_suffix(".tmp")
7 tmp_file.write_text(text)
8 tmp_file.rename(path)

Callers 4

_saveMethod · 0.90
_saveMethod · 0.90
_saveMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected