-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to mimic a zip file created by a Linux file-system. #325
Conversation
…tion time; don't mask VersionMadeBy
I would prefer to add this by having a "host OS override" that can be set and which in turn sets the top version byte. |
There is a The big problem, IMO, is the If Let me know how you would like me to proceed and I'll update the pull-request. Thanks! |
So, wouldn't just fixing the HostSystem property be enough then? |
I think so, yes. That would probably work. Let me give it a shot and update the pull-request. |
@piksel |
As it turns out, it's not possible to set the |
…nux file-system * respect the VersionMadeBy property of ZipEntry * correctly set HostSystem without clearing version (cherry picked from commit 43fd81e)
Use Case
Create a zip archive with specific permissions, such as the executable flag, using the
ExternalAttributes
property. The Linuxunzip
command only applies such permissions if the zip entry indicates the file was added by a Linux host-system.Solution
Expose the more specific
ZipEntry
constructors that allow controlling the version number and host-system information. Ensure this information is used when creating the zip archive.Changes:
internal
topublic
on constructors forZipEntry
. This allows setting themadeByInfo
value.VersionMadeBy
property to return the entireushort
. This is required byZipFile
andZipOutputStream
to write the correct value.HostSystem
property to clear out the upper byte where the host system information is stored.ZipFile
andZipOutputStream
to respect theVersionMadeBy
value of theZipEntry
instance instead of hard-coding it.Agreement
I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.