Conversation
As per zip spec we may want to encode host version. This version is used by e.g. the unzip utility in order to understand how to interpret external info (type of files and permissions). Current algorithm is pretty naive, we do not test for all OS versions supported by zip. Instead we check if we run on windows and put 0 in that case (MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems). Otherwise we put 3 (UNIX). This way code works properly on the unix OS, and we keep old behavior for the other OS. Note that we didn't change ‘toVersion’ function, as it already masked the higher byte where OS information was stored. This code was tested manually by storing archive and then unarchiving it via unzip. There is no automated test because such test would require external tools (unzip).
4399e3c to
840e599
Compare
mrkkrp
left a comment
There was a problem hiding this comment.
Thanks! Please also see what I had to change. I feel like you went into too many details which not everyone wants to read (normally I want to know as little as possible unless I need to debug it or something). Depending on unix is not necessary in this case, as well as conditional compilation. Changelog entries are a good idea.
It was very hard to set permissions using this library, as the permissions were not properly documented. Here we try to solve the problem in 2 ways: 1. We add a low level documentation that explains how to work with permissions. 2. We introduce unix specific helpers that allow to describe permissions in a human readable way. Unfortunately making those helpers OS agnostic is a pretty hard task we enable them only on the Unix platforms.
|
To be honest, having those docs in the package would have saved at least 2 hours of my life. It was not that easy to find relevant documentation that is complete enough. Though I get why you don't want to keep that in package docs. Wrt |
This is understandable, but now we have functions that work as a complete solution to this problem, so explaining the algorithm itself is not necessary. |
|
Released 1.4.0 with the changes. |
This PR fixes setting archive version so unzip tool handles,
permissions set by the library well. In addition in introduces
the helpers for converting unix permissions into the external file
attributes value.
Fixes #62.