Skip to content

fix: preserve file mtime after atomic rewrite#48

Closed
leno23 wants to merge 1 commit into
dolph:mainfrom
leno23:fix/preserve-mtime-23
Closed

fix: preserve file mtime after atomic rewrite#48
leno23 wants to merge 1 commit into
dolph:mainfrom
leno23:fix/preserve-mtime-23

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Call os.Chtimes on the temp file before Rename so modification time matches the original file
  • Add regression test for mtime preservation

Fixes #23

Test plan

  • go test ./...

Call os.Chtimes on the temp file before rename so Make-style
dependency tracking and watchers see a stable modification time.

Fixes dolph#23
@leno23 leno23 force-pushed the fix/preserve-mtime-23 branch from 3e6862a to 4bec93f Compare May 17, 2026 15:50
@dolph dolph closed this May 18, 2026
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.

mtime is not preserved after rewrite

2 participants