1zipfile::mkzip(n) Zip archive creation zipfile::mkzip(n)
2
3
4
5______________________________________________________________________________
6
8 zipfile::mkzip - Build a zip archive
9
11 package require Tcl 8.6
12
13 package require zipfile::mkzip ?1.2?
14
15 ::zipfile::mkzip::mkzip zipfile ?-zipkit? ?-runtime prefix? ?-comment
16 string? ?-directory rootpath? ?-exclude exclude? ?--? ?path...?
17
18______________________________________________________________________________
19
21 This package utilizes the zlib functions in Tcl 8.6 to build zip ar‐
22 chives.
23
25 ::zipfile::mkzip::mkzip zipfile ?-zipkit? ?-runtime prefix? ?-comment
26 string? ?-directory rootpath? ?-exclude exclude? ?--? ?path...?
27 From http://wiki.tcl.tk/15158
28
29 This command constructs a zip archive from a directory tree
30 using nothing but Tcl 8.6 core features. The resulting zip file
31 should be compatible with other zip programs - with the possible
32 exception of unicode support. The files generated by this com‐
33 mand use utf-8 encoding for all filenames and comments and it
34 has been noticed particularly on Windows the info-zip and the
35 Windows built-in zip view have rather poor support for this part
36 of the ZIP file specification. The 7-Zip program does correctly
37 display utf8 filenames however and the vfs::zip package will use
38 these of course.
39
40 If you use
41
42 ::mkzip::mkzip mystuff.tm -zipkit -directory mystuff.vfs
43
44 it will pack your "mystuff.vfs/" virtual filesystem tree into a
45 zip archive with a suitable header such that on unix you may
46 mark it executable and it should run with tclkit. Or you can run
47 it with tclsh or wish 8.6 if you like.
48
49 To change the executable header, specify the -runtime "preface"
50 where preface is a file containing code you want prefixed. For
51 instance, on Windows you can create a self-extracting zip ar‐
52 chive using
53
54
55 mkzip mystuff.exe -directory mystuff.vfs -runtime unzipsfx.exe
56
57
58 The "unzipsfx.exe" is the Info-Zip self-extracting stub.
59
60 Accepted options:
61
62 -runtime path
63 This option specifies a file to use as prefix to the
64 actual zip archive. If specified -zipkit will be ignored.
65
66 -zipkit
67 Instructs the command to generate a prefix which makes
68 the archive a zip-based starkit. Ignored if -runtime is
69 present.
70
71 -comment string
72 This options specifies a global comment to place into the
73 generated archive.
74
75 -directory path
76 This option specifies the directory to place into the
77 generated archive. If specified any argument paths are
78 ignored.
79
80 -exclude list
81 This option specifies a list of glob patterns. All paths
82 matching at least one of the patterns are not placed into
83 the generated archive. This option defaults to
84
85
86 CVS/* */CVS/* *~ ".#*" "*/.#*"
87
88
89 -- This option signals the end of the options, forcing pro‐
90 cessing of all further words as arguments, even if they
91 begin with a dash character.
92
93 Accepted arguments:
94
95 path path
96 Each path is a directory or file to place into the gener‐
97 ated archive. Note however that these will be ignored
98 when option -directory is specified.
99
101 This document, and the package it describes, will undoubtedly contain
102 bugs and other problems. Please report such in the category zipfile of
103 the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please
104 also report any ideas for enhancements you may have for either package
105 and/or documentation.
106
107 When proposing code changes, please provide unified diffs, i.e the out‐
108 put of diff -u.
109
110 Note further that attachments are strongly preferred over inlined
111 patches. Attachments can be made by going to the Edit form of the
112 ticket immediately after its creation, and then using the left-most
113 button in the secondary navigation bar.
114
116 decompression, zip
117
119 File
120
122 Copyright (c) 2009 Pat Thoyts
123
124
125
126
127tcllib 1.2 zipfile::mkzip(n)