Bug 14171 - [feature request] zip program
Summary: [feature request] zip program
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-22 18:49 UTC by Vadim Kantorov
Modified: 2021-10-07 23:31 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim Kantorov 2021-08-22 18:49:35 UTC
Compressing "zip" utility would be useful (e.g. so that this archive could be opened on Windows without installing additional software) to have in addition to existing "unzip".

For my usecase I rolled my own https://github.com/vadimkantorov/busyz (as busybox applet in https://github.com/busytex/busyide/blob/main/busyz.c) using https://github.com/richgel999/miniz
Comment 1 Denys Vlasenko 2021-10-07 23:31:25 UTC
miniz.c is WAY too large.

$ cc -Os -c miniz.c 
miniz.c:3079:9: note: ‘#pragma message: Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.’
 3079 | #pragma message("Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.")
      |         ^~~~~~~
$ size miniz.o 
   text	   data	    bss	    dec	    hex	filename
  57201	      0	      0	  57201	   df71	miniz.o

For comparison, existing busybox code to handle zip file format:
$ size unzip.o 
   text	   data	    bss	    dec	    hex	filename
   3799	      0	      0	   3799	    ed7	unzip.o
gzip decompressor per se:
$ size libarchive/decompress_gunzip.o
   text	   data	    bss	    dec	    hex	filename
   4950	      0	      0	   4950	   1356	libarchive/decompress_gunzip.o
and the gzip compression code:
$ size gzip.o 
   text	   data	    bss	    dec	    hex	filename
   5854	      0	      0	   5854	   16de	gzip.o

I would prefer something like 15kb or less of code to support .zip file creation. Not 57kb.