Skip to content

Conversation

@thejoshwolfe
Copy link
Owner

@thejoshwolfe thejoshwolfe commented Nov 3, 2024

In an attempt to fix this: thejoshwolfe/yazl#70 , I learned how modern (circa 2008) zip file implementations encode timestamps in a not-terrible way. Let's add support to yauzl, then yazl.

This change will cause timestamps read by yauzl to be slightly more precise. If this throws off any unit tests that expect an exact value, you can either adjust the test or set {forceDosFormat:true} to restore the old behavior. I'm considering this to be a feature addition rather than a breaking change for semver purposes, because I believe the extra precision is generally an improvement and not a breaking change, but please open bug reports if you find a significant regression in the behavior.

This change enables reading timestamps outside the range allowed by DOS, notably the UNIX epoch in 1970 is now possible, provided that the zip file creator used one of the supported extensions.

@thejoshwolfe thejoshwolfe merged commit 421c51f into master Nov 3, 2024
5 checks passed
@thejoshwolfe thejoshwolfe deleted the extended-timestamp branch November 3, 2024 01:43
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.

2 participants