-
Notifications
You must be signed in to change notification settings - Fork 316
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
Unix execution bits are not preserved when unzipping on macOS Catalina or Linux #183
Comments
Zip4j writes file executable information in external file attributes as specified by the zip specification. I have just investigated this issue, and I can see that the executable flag is in fact being written in the external file attributes part of the zip headers. Try extracting the zip file created with zip4j with zip4j, 7zip, The Unarchiver or Keka, and you will see that the executable flag is in fact set for the extracted file. It is only the
Update: See comment below |
After some more research, I think I found the issue, and I understand the points you made with the FAT and Unix file format. The issue here is with the bytes defined in |
Issue fixed. I will include the fix in the next release. By default platform will be determined by the OS, but you will be able to force using unix mode by |
Issue fixed in v2.6.0 released today |
Thanks! That fixes my problem. |
Reproduction steps:
unzip
command in macOS or Linux.The unit test below also reproduces the problem as long as your system has the
unzip
command.The problem is that Zip4j uses FAT file format instead of Unix. This forum thread goes into more detail on the problem, including how to identify the file format using
zipinfo
and how to set the correct flags in a different language (Visual Basic?). Apache Commons Compress hassetUnixMode
to switch from FAT to Unix mode, but it's missing other features that Zip4j has. Would it be possible for FAT vs. Unix mode to be configurable in Zip4j?The text was updated successfully, but these errors were encountered: