1zipfile::decode(n) Zip archive handling zipfile::decode(n)
2
3
4
5______________________________________________________________________________
6
8 zipfile::decode - Access to zip archives
9
11 package require Tcl 8.4
12
13 package require fileutil::magic::mimetype
14
15 package require fileutil::decode 0.2.1
16
17 package require Trf
18
19 package require zlibtcl
20
21 package require zipfile::decode ?0.7.1?
22
23 ::zipfile::decode::archive
24
25 ::zipfile::decode::close
26
27 ::zipfile::decode::comment adict
28
29 ::zipfile::decode::content archive
30
31 ::zipfile::decode::copyfile adict path dst
32
33 ::zipfile::decode::files adict
34
35 ::zipfile::decode::getfile zdict path
36
37 ::zipfile::decode::hasfile adict path
38
39 ::zipfile::decode::iszip archive
40
41 ::zipfile::decode::open archive
42
43 ::zipfile::decode::unzip adict dstdir
44
45 ::zipfile::decode::unzipfile archive dstdir
46
47______________________________________________________________________________
48
50 This package provides commands to decompress and access the contents of
51 zip archives.
52
54 ::zipfile::decode::archive
55 This command decodes the last opened (and not yet closed) zip
56 archive file. The result of the command is a dictionary
57 describing the contents of the archive. The structure of this
58 dictionary is not public. Proper access should be made through
59 the provided accessor command of this package.
60
61 ::zipfile::decode::close
62 This command releases all state associated with the last call of
63 ::zipfile::decode::open. The result of the command is the empty
64 string.
65
66 ::zipfile::decode::comment adict
67 This command takes a dictionary describing the currently open
68 zip archive file, as returned by ::zipfile::decode::archive, and
69 returns the global comment of the archive.
70
71 ::zipfile::decode::content archive
72 This is a convenience command which decodes the specified zip
73 archive file and returns the list of paths found in it as its
74 result.
75
76 ::zipfile::decode::copyfile adict path dst
77 This command takes a dictionary describing the currently open
78 zip archive file, as returned by ::zipfile::decode::archive, and
79 copies the decompressed contents of the file path in the archive
80 to the the file dst. An error is thrown if the file is not
81 found in the archive.
82
83 ::zipfile::decode::files adict
84 This command takes a dictionary describing the currently open
85 zip archive file, as returned by ::zipfile::decode::archive, and
86 returns the list of files found in the archive.
87
88 ::zipfile::decode::getfile zdict path
89 This command takes a dictionary describing the currently open
90 zip archive file, as returned by ::zipfile::decode::archive, and
91 returns the decompressed contents of the file path in the ar‐
92 chive. An error is thrown if the file is not found in the ar‐
93 chive.
94
95 ::zipfile::decode::hasfile adict path
96 This command takes a dictionary describing the currently open
97 zip archive file, as returned by ::zipfile::decode::archive, and
98 check if the specified path is found in the archive. The result
99 of the command is a boolean flag, true if the path is found, and
100 false otherwise.
101
102 ::zipfile::decode::iszip archive
103 This command takes the path of a presumed zip archive file and
104 returns a boolean flag as the result of the command telling us
105 if it actually is a zip archive (true), or not (false).
106
107 ::zipfile::decode::open archive
108 This command takes the path of a zip archive file and prepares
109 it for decoding. The result of the command is the empty string.
110 All important information is stored in global state. If multi‐
111 ple open calls are made one after the other only the state of
112 the last call is available to the other commands.
113
114 ::zipfile::decode::unzip adict dstdir
115 This command takes a dictionary describing the currently open
116 zip archive file, as returned by ::zipfile::decode::archive, and
117 unpacks the archive in the given destination directory dstdir.
118 The result of the command is the empty string.
119
120 ::zipfile::decode::unzipfile archive dstdir
121 This is a convenience command which unpacks the specified zip
122 archive file in the given destination directory dstdir.
123
124 The result of the command is the empty string.
125
127 This document, and the package it describes, will undoubtedly contain
128 bugs and other problems. Please report such in the category zipfile of
129 the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please
130 also report any ideas for enhancements you may have for either package
131 and/or documentation.
132
133 When proposing code changes, please provide unified diffs, i.e the out‐
134 put of diff -u.
135
136 Note further that attachments are strongly preferred over inlined
137 patches. Attachments can be made by going to the Edit form of the
138 ticket immediately after its creation, and then using the left-most
139 button in the secondary navigation bar.
140
142 decompression, zip
143
145 File
146
148 Copyright (c) 2008-2016 Andreas Kupries
149
150
151
152
153tcllib 0.7.1 zipfile::decode(n)