icsharpcode/SharpZipLib

Original DateTime/DosTime value

Elektrik1 opened this issue · 0 comments

Is your feature request related to a problem? Please describe.

I ran into an issue with with copying file from ZipInputStream to ZipOutputStream with preserving file Modification Time.
Date is being applied by simple assignment targetfile.DateTime = sourcefile.DateTime, but this date is off by two hours (in my case) from original datetime, because of this line in ZipEntry.cs (939):
DateTime = GetDateTime(extraData) ?? DateTime;
It overwrites correct DateTime read from DosTime by incorrect UnixData time, so original DateTime value is lost inside the library

Describe the solution you'd like

Expose original value in public property, so it would be possible to read out two dates - DateTime and Unix one gathered from ExtraData separately.

Describe alternatives you've considered

Unfortunately no alternatives has been found to skip ExtraData readout.

Tags

ZIP

Additional context

No response