-
Notifications
You must be signed in to change notification settings - Fork 80
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
add entry.getMode() #102
Comments
Never implemented? |
+1 |
Here's what we need to test before we can implement this: On Windows, create zip archives with each of the following tools:
The archive should contain:
With all that data, I would be confident enough to implement and document a I'm less enthusiastic about supporting Mac due to the atrocious Archive Utility implementation. If it's buggy, let it be buggy. |
To unzip MacOS and Linux archives, I use this logic: function modeFromEntry(entry) {
const attr = entry.externalFileAttributes >> 16 || 33188;
return [448, 56, 7
.map(mask => attr & mask)
.reduce((a, b) => a + b, attr & 61440);
}
const isSymlink = const isSymlink = ((modeFromEntry(entry) & 0o170000) === 0o120000); Been a while since I've looked at this code so can't remember the exact implementation details. Will try to dig up the references I used to put this together. |
This issue was raised in #101.
We should implement a function to read externalFileAttributes and return the mode aka permission bits. it might be as simple as:
but this may only be correct when the entry is made by a unix zipfile creator. We should investigate how various zipfile creators encode permissions, especially windows clients.
The text was updated successfully, but these errors were encountered: