mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #904] Provide access to extended attributes for 7-zip #1330
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/904
State: closed
Merged: Yes
Some 7-zip archives have extended attributes to store Unix permissions. This caused problems in the past so the extended attributes were stripped when reading. However, this information can be useful or even critical in some cases, such as when extracting Linux/macOS prebuilt binaries for developing with Qt. These archives have execute permissions set for some files, and some of the files are intended to be created as symbolic links.
This PR provides access to the original full attributes via a new property in
SevenZipEntry. The other changes were just small cleanups. Specifically, as I looked atAttribDefined/SetAttriband wondered if there should be extended versions of these, I saw that these are properties in an internal class an nothing is ever referencing them. I also noticedCrcDefinedhad only one reference, and around where it was used showed an IDE warning that went away by usingHasValueinstead, so I thought it would be better to remove it.With this new
ExtendedAttribproperty, I was able to write an extraction routine that allows the Qt 7-zip archives to be extracted in a fully working state.