Files
zip/Codec
Alexander Vershilov 72970d9e47 Add OS version to the required/made by versions
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).
2020-03-11 20:35:34 +01:00
..