Skip to content

Ensure FAT file timestamps match when files were written - #32

Merged
deadprogram merged 1 commit into
tinygo-org:releasefrom
davecheney:dfc/fatfs-timestamps
Oct 13, 2026
Merged

deadprogram merged 1 commit into
tinygo-org:releasefrom
davecheney:dfc/fatfs-timestamps

Conversation

@davecheney

Copy link
Copy Markdown
Contributor

Fixes #31

An off-by-one error in the bit shifts and seconds mask caused timestamps to be incorrectly packed into the FAT timestamp structure. This caused files to report incorrect modification dates and times.

An off-by-one error in the bit shifts and seconds mask caused timestamps to be incorrectly packed into the FAT timestamp structure. This caused files to report incorrect modification dates and times.
@davecheney
davecheney force-pushed the dfc/fatfs-timestamps branch from 0762bbe to 664ca20 Compare October 7, 2026 04:42
@davecheney
davecheney requested a review from deadprogram October 7, 2026 22:15
@deadprogram

Copy link
Copy Markdown
Member

@davecheney I am using https://github.com/soypat/fat with some success

@davecheney

Copy link
Copy Markdown
Contributor Author

@deadprogram thanks for the advice. Tinyfs works for my project at the moment so I’d like to land this fix, plus another that removes an allocation the readdir path, to follow the Boy Scout rule.

@deadprogram deadprogram left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the correction @davecheney

@deadprogram
deadprogram merged commit 5c3cc5c into tinygo-org:release Oct 13, 2026
1 check passed
@davecheney
davecheney deleted the dfc/fatfs-timestamps branch October 13, 2026 11:56
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.

FAT files store incorrect modification dates and times

2 participants