Open rsc opened 1 year ago
Change https://go.dev/cl/513437 mentions this issue: archive/zip: ignore modified time if extended timestamp extra field exists
If there is already a extTimeExtraID entry in Extra, we shold not add an extra extTimeExtraID.
Should it ignore fh.Modified or overwrite existing extra field?
Change https://go.dev/cl/513836 mentions this issue: archive/zip: update extended timestamp field if exists
Should it ignore fh.Modified or overwrite existing extra field?
I think it should update existing extended timestamp field otherwise there is no way to do it without digging into extra fields. Created https://github.com/golang/go/pull/61622 that implements this.
If you use zip.(*Writer).CreateHeader (for example using a header from a zip file you are copying), CreateHeader encodes fh.Modified into fh.Extra even if fh.Extra already contains a modified time. You get an Extra with an extra extTimeExtraID entry. If there is already a extTimeExtraID entry in Extra, we shold not add an extra extTimeExtraID.