The extract files` modified time are wrong. #252

Closed
opened 2026-01-29 22:09:02 +00:00 by claunia · 3 comments
Owner

Originally created by @WcLyic on GitHub (Oct 20, 2017).

Version:0.18.2
Archive:TestArchives\Archives\Zip.deflate.zip

Below is the code i used. The extract files` modifiled time just like the create time rather than the modifiled time of original file.

using (archive = ArchiveFactory.Open(path,
    new ReaderOptions { ArchiveEncoding = new SharpCompress.Common.ArchiveEncoding { Default = Encoding.Default } }))
{
    archive.WriteToDirectory(expath,
        new ExtractionOptions
       {
            ExtractFullPath = true,
            Overwrite = true
       });
 }
Originally created by @WcLyic on GitHub (Oct 20, 2017). Version:0.18.2 Archive:TestArchives\Archives\Zip.deflate.zip Below is the code i used. The extract files` modifiled time just like the create time rather than the modifiled time of original file. ```csharp using (archive = ArchiveFactory.Open(path, new ReaderOptions { ArchiveEncoding = new SharpCompress.Common.ArchiveEncoding { Default = Encoding.Default } })) { archive.WriteToDirectory(expath, new ExtractionOptions { ExtractFullPath = true, Overwrite = true }); } ```
Author
Owner

@adamhathcock commented on GitHub (Oct 23, 2017):

Sorry, I think you'll have to be more specific.

The modified time of the extracted file matches the create time instead of using the last modified time from the zip?

@adamhathcock commented on GitHub (Oct 23, 2017): Sorry, I think you'll have to be more specific. The modified time of the extracted file matches the create time instead of using the last modified time from the zip?
Author
Owner

@WcLyic commented on GitHub (May 19, 2018):

Version:0.21.1
Sample:Link

Sorry for reply after long time. Here is the sample of what I want to point out.

In archive:
image
After extracting:
image

@WcLyic commented on GitHub (May 19, 2018): Version:0.21.1 Sample:[Link](https://mega.nz/#!UwslzaCD!TR24QtW_B6p4W9Jz1ufQB0WCBZL6Ntj4e3BUtp354vY) Sorry for reply after long time. Here is the sample of what I want to point out. In archive: ![image](https://user-images.githubusercontent.com/29097441/40265832-6e2fbc0c-5b72-11e8-902e-8a027edf2946.png) After extracting: ![image](https://user-images.githubusercontent.com/29097441/40265837-83614a28-5b72-11e8-8bf3-debe65519647.png)
Author
Owner

@WcLyic commented on GitHub (May 21, 2018):

Finally I found the option "PreserveFileTime", it solved my question.

@WcLyic commented on GitHub (May 21, 2018): Finally I found the option "PreserveFileTime", it solved my question.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#252