Skip to content
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

Preserve file permissions via external attributes #10

Open
fasterthanlime opened this issue Sep 21, 2015 · 2 comments
Open

Preserve file permissions via external attributes #10

fasterthanlime opened this issue Sep 21, 2015 · 2 comments

Comments

@fasterthanlime
Copy link

Hey there - first off, thanks for the unzip fork, definitely appreciated!

My only concern is that I'm trying to extract .zip files containing applications, on OSX & Linux. For those to work, the executables need to have the right permissions (notably, the executable bit must be set).

In the original ZIP format, there was no way to do that - but later on, OSX & Linux versions of zip & unzip added support for it by (ab)using the 'external attribute' field in the ZIP entry table.

See for reference:

Do you have any pointers on how I would go about retrieving the external file attributes for a zip entry? It doesn't seem to be included in the 'entry' event of unzip.Parse().

@fasterthanlime
Copy link
Author

After further investigation, it seems parser.js already has that information! Here's how I was able to display permissions: fasterthanlime@5a21d60

Any idea how to integrate it into the current API? it seems 'file' and 'central directory header' entries are distinct, so perhaps a different event would make sense?

@fasterthanlime
Copy link
Author

Following up on this, we're currently successfully using the quick-hack branch of our fork (cf. comparison with node-unzip-2 master).

It's probably not the best interface though, so I'm looking forward to get feedback from you on how this could be integrated in the main repo. I'd prefer not to keep our fork around for too long!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant