Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archive/zip: FileHeader.FileInfo().ModTime() should use Modified #28350

Closed
Xjs opened this issue Oct 24, 2018 · 4 comments
Closed

archive/zip: FileHeader.FileInfo().ModTime() should use Modified #28350

Xjs opened this issue Oct 24, 2018 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@Xjs
Copy link
Contributor

Xjs commented Oct 24, 2018

Since Go 1.10, archive/zip.FileHeader contains a Modified field supporting extended timestamps. However, FileHeader.FileInfo() returns a os.FileInfo implementation whose ModTime() method still returns the legacy mod time. This should be changed to return Modified. A hint documenting that FileInfo() uses legacy fields would be nice for the time being.

As far as I can tell, headerFileInfo has direct access to the Modified field. Is there a reason why it wasn't included that I am missing, or was it just an oversight?

@gopherbot
Copy link

Change https://golang.org/cl/144382 mentions this issue: archive/zip: use Modified in FileHeader.FileInfo()

@mattn
Copy link
Member

mattn commented Oct 24, 2018

As far as I remember, this is discussed in #18359

@bcmills
Copy link
Contributor

bcmills commented Oct 24, 2018

CC @dsnet @bradfitz

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 24, 2018
@bcmills bcmills added this to the Unplanned milestone Oct 24, 2018
@dsnet
Copy link
Member

dsnet commented Oct 24, 2018

Already commented on the CL. I believe the change is in the right direction, but needs to have a fallback for the legacy timestamp fields.

@golang golang locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants