Skip to content

Add Rename and Sync capabilities for atomic writes#6

Merged
mojatter merged 1 commit intomainfrom
feat/rename-sync-issue-5
Apr 6, 2026
Merged

Add Rename and Sync capabilities for atomic writes#6
mojatter merged 1 commit intomainfrom
feat/rename-sync-issue-5

Conversation

@mojatter
Copy link
Copy Markdown
Owner

@mojatter mojatter commented Apr 6, 2026

Introduces RenameFS and SyncWriterFile capability interfaces so callers can implement crash-safe atomic writes (temp file + sync + rename) through the wfs abstraction without bypassing it. osfs wraps os.Rename and (*os.File).Sync; memfs moves entries under its mutex and treats Sync as a no-op so the same caller code works on both backends.

Closes #5

Introduces RenameFS and SyncWriterFile capability interfaces so callers
can implement crash-safe atomic writes (temp file + sync + rename)
through the wfs abstraction without bypassing it. osfs wraps os.Rename
and (*os.File).Sync; memfs moves entries under its mutex and treats
Sync as a no-op so the same caller code works on both backends.

Closes #5
@mojatter mojatter force-pushed the feat/rename-sync-issue-5 branch from df340dd to fc6b212 Compare April 6, 2026 03:50
@mojatter mojatter merged commit 3967050 into main Apr 6, 2026
1 check passed
@mojatter mojatter deleted the feat/rename-sync-issue-5 branch April 6, 2026 03:50
mojatter added a commit that referenced this pull request Apr 7, 2026
The original v0.5.0 entry attributed PRs #6-#10 (Rename/Sync, lint CI,
memfs Sub fix, store perf, memfs docs) to v0.5.0, but those were
already shipped in v0.4.1. Rewrite the entry to reflect what is
actually new since v0.4.1: README additions, CHANGELOG itself, the
Go matrix and -race CI, the Go 1.24 minimum, and the NewOSFS
deprecation timeline.
@mojatter mojatter mentioned this pull request Apr 7, 2026
2 tasks
mojatter added a commit that referenced this pull request Apr 7, 2026
The original v0.5.0 entry attributed PRs #6-#10 (Rename/Sync, lint CI,
memfs Sub fix, store perf, memfs docs) to v0.5.0, but those were
already shipped in v0.4.1. Rewrite the entry to reflect what is
actually new since v0.4.1: README additions, CHANGELOG itself, the
Go matrix and -race CI, the Go 1.24 minimum, and the NewOSFS
deprecation timeline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Rename and Sync to WriteFileFS for atomic writes

1 participant