File: decode.man

package info (click to toggle)
tcllib 1.20%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 68,064 kB
  • sloc: tcl: 216,842; ansic: 14,250; sh: 2,846; xml: 1,766; yacc: 1,145; pascal: 881; makefile: 107; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (135 lines) | stat: -rw-r--r-- 5,145 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
[vset ZIP_DECODE_VERSION 0.7.1]
[comment {-*- tcl -*- doctools manpage}]
[manpage_begin zipfile::decode n [vset ZIP_DECODE_VERSION]]
[keywords decompression zip]
[copyright {2008-2016 Andreas Kupries}]
[moddesc {Zip archive handling}]
[titledesc {Access to zip archives}]
[category  File]
[require Tcl 8.4]
[require fileutil::magic::mimetype]
[require fileutil::decode 0.2.1]
[require Trf]
[require zlibtcl]
[require zipfile::decode [opt [vset ZIP_DECODE_VERSION]]]
[description]
[para]

This package provides commands to decompress and access the contents
of zip archives.

[section API]

[list_begin definitions]
[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::archive]]

This command decodes the last opened (and not yet closed) zip archive
file.

The result of the command is a dictionary describing the contents of
the archive. The structure of this dictionary is not public. Proper
access should be made through the provided accessor command of this
package.

[comment { -- TODO? -- dictionary contents -- }]

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::close]]

This command releases all state associated with the last call of
[cmd ::zipfile::decode::open].

The result of the command is the empty string.

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::comment] [arg adict]]

This command takes a dictionary describing the currently open zip
archive file, as returned by [cmd ::zipfile::decode::archive], and
returns the global comment of the archive.

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::content] [arg archive]]

This is a convenience command which decodes the specified zip
[arg archive] file and returns the list of paths found in it as its
result.

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::copyfile] [arg adict] [arg path] [arg dst]]

This command takes a dictionary describing the currently open zip
archive file, as returned by [cmd ::zipfile::decode::archive], and
copies the decompressed contents of the file [arg path] in the archive
to the the file [arg dst].

An error is thrown if the file is not found in the archive.

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::files] [arg adict]]

This command takes a dictionary describing the currently open zip
archive file, as returned by [cmd ::zipfile::decode::archive], and
returns the list of files found in the archive.

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::getfile] [arg zdict] [arg path]]

This command takes a dictionary describing the currently open zip
archive file, as returned by [cmd ::zipfile::decode::archive], and
returns the decompressed contents of the file [arg path] in the archive.

An error is thrown if the file is not found in the archive.

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::hasfile] [arg adict] [arg path]]

This command takes a dictionary describing the currently open zip
archive file, as returned by [cmd ::zipfile::decode::archive], and
check if the specified [arg path] is found in the archive.

The result of the command is a boolean flag, [const true] if the path
is found, and [const false] otherwise.

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::iszip] [arg archive]]

This command takes the path of a presumed zip [arg archive] file and
returns a boolean flag as the result of the command telling us if it
actually is a zip archive ([const true]), or not ([const false]).

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::open] [arg archive]]

This command takes the path of a zip [arg archive] file and prepares
it for decoding.

The result of the command is the empty string.

All important information is stored in global state.  If multiple open
calls are made one after the other only the state of the last call is
available to the other commands.

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::unzip] [arg adict] [arg dstdir]]

This command takes a dictionary describing the currently open zip
archive file, as returned by [cmd ::zipfile::decode::archive], and
unpacks the archive in the given destination directory [arg dstdir].

The result of the command is the empty string.

[comment ---------------------------------------------------------------------]
[call [cmd ::zipfile::decode::unzipfile] [arg archive] [arg dstdir]]

This is a convenience command which unpacks the specified zip
[arg archive] file in the given destination directory [arg dstdir].

[para] The result of the command is the empty string.

[list_end]

[vset CATEGORY zipfile]
[include ../common-text/feedback.inc]
[manpage_end]