SharpZipLib icon indicating copy to clipboard operation
SharpZipLib copied to clipboard

FastZip does not set Directory attributes on extract

Open ZTHawk opened this issue 5 years ago • 7 comments

Steps to reproduce

  1. Initialize A FastZip object with RestoreDateTimeOnExtract and/or RestoreAttributesOnExtract is set to true
  2. Extract a zip file that contains at least one folder

Expected behavior

All extracted folders should have their original datetime and/or file attributes set as defined in the zip file.

Actual behavior

Folders have no attributes set and datetime is not the one defined in the zip file.

Version of SharpZipLib

All

Obtained from (only keep the relevant lines)

  • Package installed using NuGet

ZTHawk avatar Feb 25 '20 07:02 ZTHawk

No, you're right, that's not supported right now.

But please update the issue with the issue template.

piksel avatar Mar 27 '20 19:03 piksel

@ZTHawk does the change in #433 help with the directory modified times in your case? (That change purely does times to keep it simple)

Numpsy avatar Apr 05 '20 10:04 Numpsy

What do you mean by "does times"? As in, that it doesn't cover attributes? I'm not even sure how attributes on directories work, as there are no Get/SetAttributes in System.IO.Directory.

piksel avatar Apr 07 '20 17:04 piksel

Yes, that it doesn't cover attributes.

I haven't really thought about the attribute side, but they can be accessed via the Attributes property on DirectoryInfo (ZipEntryFactory uses that to read them when creating entries)

Numpsy avatar Apr 07 '20 19:04 Numpsy

Turns out that you can use File.SetAttributes() on directories too. Oh well.

piksel avatar Apr 11 '20 18:04 piksel

Merging #433 should have fixed the timestamp part of this.

Numpsy avatar Jun 20 '20 18:06 Numpsy

Renaming this since it's partially resolved.

piksel avatar Nov 10 '20 18:11 piksel