Skip to content

fix: check the close of atomically written files - #91

Merged
HaoZeke merged 1 commit into
developfrom
fix/atomic-write-close
Nov 25, 2026
Merged

HaoZeke merged 1 commit into
developfrom
fix/atomic-write-close

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

atomicWrite and atomicWriteAt close the temporary file once, before
the rename. A failed close removes the temporary file, leaves the
destination unchanged, and returns the errno the other steps return.
A close that a signal interrupts is not retried and is not an error,
which is how sys.result treats it. The close goes through atomic.ops
so a test can inject a failure.

atomicWrite and atomicWriteAt close the temporary file once, before
the rename. A failed close removes the temporary file, leaves the
destination unchanged, and returns the errno the other steps return.
A close that a signal interrupts is not retried and is not an error,
which is how sys.result treats it. The close goes through atomic.ops
so a test can inject a failure.
@HaoZeke
HaoZeke merged commit 1a33654 into develop Nov 25, 2026
8 checks passed
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.

1 participant