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

Comments

@Xjs
Copy link
Contributor

@Xjs 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

@gopherbot gopherbot commented Oct 24, 2018

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

@mattn
Copy link
Member

@mattn mattn commented Oct 24, 2018

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

@bcmills
Copy link
Member

@bcmills bcmills commented Oct 24, 2018

@bcmills bcmills added this to the Unplanned milestone Oct 24, 2018
@dsnet
Copy link
Member

@dsnet 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.

@gopherbot gopherbot closed this in 20995f6 Apr 8, 2019
@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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.