Open tinesoft opened 4 years ago
I'm pretty certain there is no standardized cross-platform way of preserving file permissions in a zip archive? There are different implementations of this, but they're solution and platform specific.
Hi @warerebel ,
You mean in NodeJS?
Because when I unzip the archive on MacOs, or Windows, the execute
permission is preserved just fine on the file that has it...
Meaning the permission is preserved in the file within the archive. So it should be considered when extracting the files.
The file permissions are an attribute of the filesystem on which the zip file was created, and they're system specific.
Windows NTFS, MacOS APFS, linux ext4 all have their own way of defining file permissions. When they unzip a file they try to translate the file permissions from the source FS to the target FS, they generally do it correctly, but not always.
NodeJS is generally does host independent things. This module is really about reading zip contents into streams and processing them. The stream has no concern for the file system, it is just file content, so it has no knowledge of either the source or the destination file system.
Someone could maybe write something to replicate this behaviour in a nodejs module, but it's a very niche use case. If you just need to execute the file natively on the host system you may as well use the host's native unzip client using node's child_process
Hi,
Thanks for this great library!
I'm using it to extract a zip containing an executable file (zip file can be found here: https://start.spring.io/starter.zip, file
mvnw
inside it has theexecutable
flag)But when extracting the zip with Unzipper, the flag is lost:
Here is the relevant code:
Any idea?