{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package atomicfile\n\nPackage atomicfile writes a file so a crash mid-write never leaves it truncated: content goes to a temp file in the SAME directory, is fsync'd, then renamed over the target (an atomic operation on POSIX). Load-bearing state files (config.json, plan snapshots, job meta, checkpoint manifests) use this so a power loss / SIGKILL can't brick the project.\n\n## Functions\n\n```go\nfunc WriteFile(path string, data []byte, perm os.FileMode) error\n```\nWriteFile atomically writes data to path with the given permissions. On any failure the original file (if any) is left untouched and the temp file is cleaned up.\n\n","path":"github.com/memcode-ai/memcode/internal/atomicfile","name":"atomicfile","synopsis":"Package atomicfile writes a file so a crash mid-write never leaves it truncated: content goes to a temp file in the SAME directory, is fsync'd, then renamed over the target (an atomic operation on POSIX).","isRedistributable":true}
