icsharpcode / SharpZipLib

#ziplib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.
http://icsharpcode.github.io/SharpZipLib/
MIT License
3.73k stars 976 forks source link

Original DateTime/DosTime value #855

Open Elektrik1 opened 1 year ago

Elektrik1 commented 1 year ago

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