author | Stefan Vogel <sv@exept.de> |
Wed, 10 Jun 2009 14:53:07 +0200 | |
changeset 2161 | a737bcc07579 |
parent 2104 | 5f800e5dbb46 |
child 2173 | 254452034748 |
permissions | -rw-r--r-- |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2 |
COPYRIGHT (c) 1998 by eXept Software AG |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3 |
All Rights Reserved |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
5 |
This software is furnished under a license and may be used |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
10 |
hereby transferred. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
11 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
12 |
"{ Package: 'stx:libbasic2' }" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
13 |
|
622 | 14 |
Object subclass:#ZipArchive |
1994 | 15 |
instanceVariableNames:'file mode archiveName firstEntry lastEntry centralDirectory |
16 |
startOfArchive endOfArchive' |
|
1981
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
17 |
classVariableNames:'Lobby RecentlyUsedZipArchives FlushBlock ECREC_SIZE LREC_SIZE |
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
18 |
CREC_SIZE SIZE_CENTRAL_DIRECTORY TOTAL_ENTRIES_CENTRAL_DIR |
970 | 19 |
C_COMPRESSED_SIZE C_RELATIVE_OFFSET_LOCAL_HEADER |
20 |
C_FILENAME_LENGTH C_UNCOMPRESSED_SIZE C_CENTRALHEADERSIGNATURE |
|
21 |
C_LOCALHEADERSIGNATURE C_CENTRALENDSIGNATURE |
|
2088 | 22 |
ZipFileFormatErrorSignal UnsupportedZipFileFormatErrorSignal |
23 |
COMPR_STORED COMPR_SHRUNK COMPR_REDUCED1 COMPR_REDUCED2 |
|
24 |
COMPR_REDUCED3 COMPR_REDUCED4 COMPR_IMPLODED COMPR_TOKENIZED |
|
25 |
COMPR_DEFLATED EXTERNALFILEATTRIBUTES_ISFILE |
|
26 |
EXTERNALFILEATTRIBUTES_ISDIRECTORY' |
|
970 | 27 |
poolDictionaries:'' |
28 |
category:'System-Support-FileFormats' |
|
622 | 29 |
! |
30 |
||
1979 | 31 |
Object subclass:#ZipCentralDirectory |
32 |
instanceVariableNames:'numberOfThisDisk centralDirectoryStartDiskNumber |
|
33 |
centralDirectoryTotalNoOfEntriesOnThisDisk |
|
34 |
centralDirectoryTotalNoOfEntries centralDirectorySize |
|
35 |
centralDirectoryStartOffset zipCommentLength zipComment |
|
36 |
digitalSignatureDataSize digitalSignatureData' |
|
37 |
classVariableNames:'' |
|
38 |
poolDictionaries:'' |
|
39 |
privateIn:ZipArchive |
|
40 |
! |
|
41 |
||
622 | 42 |
Object subclass:#ZipMember |
1979 | 43 |
instanceVariableNames:'next versionMadeBy versionNeedToExtract generalPurposBitFlag |
44 |
compressionMethod lastModFileTime lastModFileDate crc32 |
|
45 |
compressedSize uncompressedSize fileNameLength extraFieldLength |
|
46 |
fileCommentLength diskNumberStart internalFileAttributes |
|
47 |
externalFileAttributes relativeLocalHeaderOffset fileName |
|
48 |
extraField fileComment dataStart data' |
|
970 | 49 |
classVariableNames:'' |
50 |
poolDictionaries:'' |
|
51 |
privateIn:ZipArchive |
|
622 | 52 |
! |
53 |
||
636 | 54 |
!ZipArchive primitiveDefinitions! |
55 |
%{ |
|
56 |
||
720 | 57 |
|
636 | 58 |
#include <stdio.h> |
59 |
||
60 |
#define uchar unsigned char |
|
61 |
#define ushort unsigned short |
|
62 |
#define ulong unsigned long |
|
63 |
||
64 |
/* |
|
65 |
* inflate definitions |
|
66 |
*/ |
|
67 |
#define PKZIP_BUG_WORKAROUND /* PKZIP 1.93a problem--live with it */ |
|
68 |
#ifndef WSIZE /* default is 32K */ |
|
69 |
# define WSIZE 0x8000 /* window size--must be a power of two, and at least */ |
|
70 |
#endif /* 32K for zip's deflate method */ |
|
71 |
||
72 |
#define NEXTBYTE (*inPtr++) |
|
637 | 73 |
#define XXXFLUSH(n) slide += (n) |
723 | 74 |
#define FLUSH(n) { bcopy(slide, outPtr, (n)); outPtr += (n); } |
75 |
||
76 |
#ifdef DEBUG |
|
1839 | 77 |
# define Trace(x) if (debugTrace) { console_fprintf x ; } |
636 | 78 |
#else |
79 |
# define Trace(x) /* nothing */ |
|
80 |
#endif |
|
81 |
||
82 |
/* Huffman code lookup table entry--this entry is four bytes for machines |
|
83 |
that have 16-bit pointers (e.g. PC's in the small or medium model). |
|
84 |
Valid extra bits are 0..13. e == 15 is EOB (end of block), e == 16 |
|
85 |
means that v is a literal, 16 < e < 32 means that v is a pointer to |
|
86 |
the next table, which codes e - 16 bits, and lastly e == 99 indicates |
|
87 |
an unused code. If a code with e == 99 is looked up, this implies an |
|
88 |
error in the data. */ |
|
89 |
struct huft { |
|
90 |
uchar e; /* number of extra bits or operation */ |
|
91 |
uchar b; /* number of bits in this code or subcode */ |
|
92 |
union { |
|
93 |
ushort n; /* literal, length base, or distance base */ |
|
94 |
struct huft *t; /* pointer to next level of table */ |
|
95 |
} v; |
|
96 |
}; |
|
97 |
||
98 |
%} |
|
99 |
! ! |
|
100 |
||
101 |
!ZipArchive primitiveVariables! |
|
102 |
%{ |
|
103 |
||
723 | 104 |
static int debugTrace = 0; |
105 |
||
636 | 106 |
/* |
107 |
* inflate variables |
|
108 |
*/ |
|
109 |
||
110 |
static unsigned char *inPtr; |
|
111 |
static unsigned char *outPtr; |
|
112 |
static unsigned char *slide; |
|
113 |
||
114 |
static int qflag = 0; |
|
115 |
||
116 |
/* The inflate algorithm uses a sliding 32K byte window on the uncompressed |
|
117 |
stream to find repeated byte strings. This is implemented here as a |
|
118 |
circular buffer. The index is updated simply by incrementing and then |
|
119 |
and'ing with 0x7fff (32K-1). */ |
|
120 |
/* It is left to other modules to supply the 32K area. It is assumed |
|
121 |
to be usable as if it were declared "uchar slide[32768];" or as just |
|
122 |
"uchar *slide;" and then malloc'ed in the latter case. The definition |
|
123 |
must be in unzip.h, included above. */ |
|
124 |
static unsigned wp; /* current position in slide */ |
|
125 |
||
126 |
||
127 |
/* Tables for deflate from PKZIP's appnote.txt. */ |
|
128 |
static unsigned border[] = { /* Order of the bit length code lengths */ |
|
1839 | 129 |
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; |
636 | 130 |
|
131 |
static ushort cplens[] = { /* Copy lengths for literal codes 257..285 */ |
|
1839 | 132 |
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, |
133 |
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; |
|
134 |
/* note: see note #13 above about the 258 in this list. */ |
|
636 | 135 |
|
136 |
static ushort cplext[] = { /* Extra bits for literal codes 257..285 */ |
|
1839 | 137 |
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, |
138 |
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}; /* 99==invalid */ |
|
636 | 139 |
|
140 |
static ushort cpdist[] = { /* Copy offsets for distance codes 0..29 */ |
|
1839 | 141 |
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, |
142 |
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, |
|
143 |
8193, 12289, 16385, 24577}; |
|
636 | 144 |
static ushort cpdext[] = { /* Extra bits for distance codes */ |
1839 | 145 |
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, |
146 |
7, 7, 8, 8, 9, 9, 10, 10, 11, 11, |
|
147 |
12, 12, 13, 13}; |
|
636 | 148 |
|
149 |
/* And'ing with mask[n] masks the lower n bits */ |
|
150 |
static ushort mask[] = { |
|
151 |
0x0000, |
|
152 |
0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, |
|
153 |
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff |
|
154 |
}; |
|
155 |
||
156 |
||
157 |
/* Macros for inflate() bit peeking and grabbing. |
|
158 |
The usage is: |
|
159 |
||
1839 | 160 |
NEEDBITS(j) |
161 |
x = b & mask[j]; |
|
162 |
DUMPBITS(j) |
|
636 | 163 |
|
164 |
where NEEDBITS makes sure that b has at least j bits in it, and |
|
165 |
DUMPBITS removes the bits from b. The macros use the variable k |
|
166 |
for the number of bits in b. Normally, b and k are register |
|
167 |
variables for speed, and are initialized at the begining of a |
|
168 |
routine that uses these macros from a global bit buffer and count. |
|
169 |
||
170 |
In order to not ask for more bits than there are in the compressed |
|
171 |
stream, the Huffman tables are constructed to only ask for just |
|
172 |
enough bits to make up the end-of-block code (value 256). Then no |
|
173 |
bytes need to be "returned" to the buffer at the end of the last |
|
174 |
block. See the huft_build() routine. |
|
175 |
*/ |
|
176 |
||
177 |
static ulong bb; /* bit buffer */ |
|
178 |
static unsigned bk; /* bits in bit buffer */ |
|
179 |
||
637 | 180 |
#define NEEDBITS(n) { while(k<(n)){ b |= ((ulong)NEXTBYTE)<<k; k+=8; } } |
181 |
#define DUMPBITS(n) { b>>=(n); k-=(n); } |
|
636 | 182 |
|
183 |
||
184 |
/* |
|
185 |
Huffman code decoding is performed using a multi-level table lookup. |
|
186 |
The fastest way to decode is to simply build a lookup table whose |
|
187 |
size is determined by the longest code. However, the time it takes |
|
188 |
to build this table can also be a factor if the data being decoded |
|
189 |
is not very long. The most common codes are necessarily the |
|
190 |
shortest codes, so those codes dominate the decoding time, and hence |
|
191 |
the speed. The idea is you can have a shorter table that decodes the |
|
192 |
shorter, more probable codes, and then point to subsidiary tables for |
|
193 |
the longer codes. The time it costs to decode the longer codes is |
|
194 |
then traded against the time it takes to make longer tables. |
|
195 |
||
196 |
This results of this trade are in the variables lbits and dbits |
|
197 |
below. lbits is the number of bits the first level table for literal/ |
|
198 |
length codes can decode in one step, and dbits is the same thing for |
|
199 |
the distance codes. Subsequent tables are also less than or equal to |
|
200 |
those sizes. These values may be adjusted either when all of the |
|
201 |
codes are shorter than that, in which case the longest code length in |
|
202 |
bits is used, or when the shortest code is *longer* than the requested |
|
203 |
table size, in which case the length of the shortest code in bits is |
|
204 |
used. |
|
205 |
||
206 |
There are two different values for the two tables, since they code a |
|
207 |
different number of possibilities each. The literal/length table |
|
208 |
codes 286 possible values, or in a flat code, a little over eight |
|
209 |
bits. The distance table codes 30 possible values, or a little less |
|
210 |
than five bits, flat. The optimum values for speed end up being |
|
211 |
about one bit more than those, so lbits is 8+1 and dbits is 5+1. |
|
212 |
The optimum values may differ though from machine to machine, and |
|
213 |
possibly even between compilers. Your mileage may vary. |
|
214 |
*/ |
|
215 |
||
216 |
||
217 |
static int lbits = 9; /* bits in base literal/length lookup table */ |
|
218 |
static int dbits = 6; /* bits in base distance lookup table */ |
|
219 |
||
220 |
||
221 |
/* If BMAX needs to be larger than 16, then h and x[] should be ulong. */ |
|
222 |
#define BMAX 16 /* maximum bit length of any code (16 for explode) */ |
|
223 |
#define N_MAX 288 /* maximum number of codes in any set */ |
|
224 |
||
225 |
||
226 |
static unsigned hufts; /* track memory usage */ |
|
227 |
||
228 |
%} |
|
229 |
! ! |
|
230 |
||
231 |
!ZipArchive primitiveFunctions! |
|
232 |
%{ |
|
233 |
||
234 |
/* |
|
235 |
* inflate algorithm |
|
236 |
*/ |
|
237 |
||
238 |
/* Free the malloc'ed tables built by huft_build(), which makes a linked |
|
239 |
list of the tables it made, with the links in a dummy first entry of |
|
240 |
each table. */ |
|
1839 | 241 |
static int |
636 | 242 |
huft_free(t) |
243 |
struct huft *t; /* table to free */ |
|
244 |
{ |
|
245 |
register struct huft *p, *q; |
|
246 |
||
247 |
||
248 |
/* Go through linked list, freeing from the malloced (t[-1]) address. */ |
|
249 |
p = t; |
|
250 |
while (p != (struct huft *)NULL) |
|
251 |
{ |
|
252 |
q = (--p)->v.t; |
|
253 |
free(p); |
|
254 |
p = q; |
|
1839 | 255 |
} |
636 | 256 |
return 0; |
257 |
} |
|
258 |
||
259 |
||
260 |
||
261 |
||
262 |
/* Given a list of code lengths and a maximum table size, make a set of |
|
263 |
tables to decode that set of codes. Return zero on success, one if |
|
264 |
the given code set is incomplete (the tables are still built in this |
|
265 |
case), two if the input is invalid (all zero length codes or an |
|
266 |
oversubscribed set of lengths), and three if not enough memory. |
|
267 |
The code with value 256 is special, and the tables are constructed |
|
268 |
so that no bits beyond that code are fetched when that code is |
|
269 |
decoded. */ |
|
1839 | 270 |
static int |
636 | 271 |
huft_build(b, n, s, d, e, t, m) |
272 |
unsigned *b; /* code lengths in bits (all assumed <= BMAX) */ |
|
273 |
unsigned n; /* number of codes (assumed <= N_MAX) */ |
|
274 |
unsigned s; /* number of simple-valued codes (0..s-1) */ |
|
275 |
ushort *d; /* list of base values for non-simple codes */ |
|
276 |
ushort *e; /* list of extra bits for non-simple codes */ |
|
277 |
struct huft **t; /* result: starting table */ |
|
278 |
int *m; /* maximum lookup bits, returns actual */ |
|
279 |
{ |
|
280 |
unsigned a; /* counter for codes of length k */ |
|
281 |
unsigned c[BMAX+1]; /* bit length count table */ |
|
282 |
unsigned el; /* length of EOB code (value 256) */ |
|
283 |
unsigned f; /* i repeats in table every f entries */ |
|
284 |
int g; /* maximum code length */ |
|
285 |
int h; /* table level */ |
|
286 |
register unsigned i; /* counter, current code */ |
|
287 |
register unsigned j; /* counter */ |
|
288 |
register int k; /* number of bits in current code */ |
|
289 |
int lx[BMAX+1]; /* memory for l[-1..BMAX-1] */ |
|
290 |
int *l = lx+1; /* stack of bits per table */ |
|
291 |
register unsigned *p; /* pointer into c[], b[], or v[] */ |
|
292 |
register struct huft *q; /* points to current table */ |
|
293 |
struct huft r; /* table entry for structure assignment */ |
|
294 |
struct huft *u[BMAX]; /* table stack */ |
|
295 |
static unsigned v[N_MAX]; /* values in order of bit length */ |
|
296 |
register int w; /* bits before this table == (l * h) */ |
|
297 |
unsigned x[BMAX+1]; /* bit offsets, then code stack */ |
|
298 |
unsigned *xp; /* pointer into x */ |
|
299 |
int y; /* number of dummy codes added */ |
|
300 |
unsigned z; /* number of entries in current table */ |
|
1749 | 301 |
extern void *malloc(); |
636 | 302 |
|
303 |
/* Generate counts for each bit length */ |
|
304 |
el = n > 256 ? b[256] : BMAX; /* set length of EOB code, if any */ |
|
305 |
bzero((char *)c, sizeof(c)); |
|
306 |
p = b; i = n; |
|
307 |
do { |
|
308 |
c[*p]++; p++; /* assume all entries <= BMAX */ |
|
309 |
} while (--i); |
|
310 |
if (c[0] == n) /* null input--all zero length codes */ |
|
311 |
{ |
|
312 |
*t = (struct huft *)NULL; |
|
313 |
*m = 0; |
|
314 |
return 0; |
|
315 |
} |
|
316 |
||
317 |
||
318 |
/* Find minimum and maximum length, bound *m by those */ |
|
319 |
for (j = 1; j <= BMAX; j++) |
|
320 |
if (c[j]) |
|
321 |
break; |
|
322 |
k = j; /* minimum code length */ |
|
323 |
if ((unsigned)*m < j) |
|
324 |
*m = j; |
|
325 |
for (i = BMAX; i; i--) |
|
326 |
if (c[i]) |
|
327 |
break; |
|
328 |
g = i; /* maximum code length */ |
|
329 |
if ((unsigned)*m > i) |
|
330 |
*m = i; |
|
331 |
||
332 |
||
333 |
/* Adjust last length count to fill out codes, if needed */ |
|
334 |
for (y = 1 << j; j < i; j++, y <<= 1) |
|
335 |
if ((y -= c[j]) < 0) |
|
336 |
return 2; /* bad input: more codes than bits */ |
|
337 |
if ((y -= c[i]) < 0) |
|
338 |
return 2; |
|
339 |
c[i] += y; |
|
340 |
||
341 |
||
342 |
/* Generate starting offsets into the value table for each length */ |
|
343 |
x[1] = j = 0; |
|
344 |
p = c + 1; xp = x + 2; |
|
345 |
while (--i) { /* note that i == g from above */ |
|
346 |
*xp++ = (j += *p++); |
|
347 |
} |
|
348 |
||
349 |
||
350 |
/* Make a table of values in order of bit lengths */ |
|
351 |
p = b; i = 0; |
|
352 |
do { |
|
353 |
if ((j = *p++) != 0) |
|
354 |
v[x[j]++] = i; |
|
355 |
} while (++i < n); |
|
356 |
||
357 |
||
358 |
/* Generate the Huffman codes and for each, make the table entries */ |
|
359 |
x[0] = i = 0; /* first Huffman code is zero */ |
|
360 |
p = v; /* grab values in bit order */ |
|
361 |
h = -1; /* no tables yet--level -1 */ |
|
362 |
w = l[-1] = 0; /* no bits decoded yet */ |
|
363 |
u[0] = (struct huft *)NULL; /* just to keep compilers happy */ |
|
364 |
q = (struct huft *)NULL; /* ditto */ |
|
365 |
z = 0; /* ditto */ |
|
366 |
||
367 |
/* go through the bit lengths (k already is bits in shortest code) */ |
|
368 |
for (; k <= g; k++) |
|
369 |
{ |
|
370 |
a = c[k]; |
|
371 |
while (a--) |
|
372 |
{ |
|
373 |
/* here i is the Huffman code of length k bits for value *p */ |
|
374 |
/* make tables up to required level */ |
|
375 |
while (k > w + l[h]) |
|
376 |
{ |
|
1839 | 377 |
w += l[h++]; /* add bits already decoded */ |
636 | 378 |
|
1839 | 379 |
/* compute minimum size table less than or equal to *m bits */ |
380 |
z = (z = g - w) > (unsigned)*m ? *m : z; /* upper limit */ |
|
381 |
if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ |
|
382 |
{ /* too few codes for k-w bit table */ |
|
383 |
f -= a + 1; /* deduct codes from patterns left */ |
|
384 |
xp = c + k; |
|
385 |
while (++j < z) /* try smaller tables up to z bits */ |
|
386 |
{ |
|
387 |
if ((f <<= 1) <= *++xp) |
|
388 |
break; /* enough codes to use up j bits */ |
|
389 |
f -= *xp; /* else deduct codes from patterns */ |
|
390 |
} |
|
391 |
} |
|
392 |
if ((unsigned)w + j > el && (unsigned)w < el) |
|
393 |
j = el - w; /* make EOB code end at table */ |
|
394 |
z = 1 << j; /* table entries for j-bit table */ |
|
395 |
l[h] = j; /* set table size in stack */ |
|
636 | 396 |
|
1839 | 397 |
/* allocate and link in new table */ |
398 |
if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) == |
|
399 |
(struct huft *)NULL) |
|
400 |
{ |
|
401 |
if (h) |
|
402 |
huft_free(u[0]); |
|
403 |
return 3; /* not enough memory */ |
|
404 |
} |
|
405 |
hufts += z + 1; /* track memory usage */ |
|
406 |
*t = q + 1; /* link to list for huft_free() */ |
|
407 |
*(t = &(q->v.t)) = (struct huft *)NULL; |
|
408 |
u[h] = ++q; /* table starts after link */ |
|
636 | 409 |
|
1839 | 410 |
/* connect to last table, if there is one */ |
411 |
if (h) |
|
412 |
{ |
|
413 |
x[h] = i; /* save pattern for backing up */ |
|
414 |
r.b = (uchar)l[h-1]; /* bits to dump before this table */ |
|
415 |
r.e = (uchar)(16 + j); /* bits in this table */ |
|
416 |
r.v.t = q; /* pointer to this table */ |
|
417 |
j = (i & ((1 << w) - 1)) >> (w - l[h-1]); |
|
418 |
u[h-1][j] = r; /* connect to last table */ |
|
419 |
} |
|
636 | 420 |
} |
421 |
||
422 |
/* set up table entry in r */ |
|
423 |
r.b = (uchar)(k - w); |
|
424 |
if (p >= v + n) |
|
1839 | 425 |
r.e = 99; /* out of values--invalid code */ |
636 | 426 |
else if (*p < s) |
427 |
{ |
|
1839 | 428 |
r.e = (uchar)(*p < 256 ? 16 : 15); /* 256 is end-of-block code */ |
429 |
r.v.n = *p++; /* simple code is just the value */ |
|
636 | 430 |
} |
431 |
else |
|
432 |
{ |
|
1839 | 433 |
r.e = (uchar)e[*p - s]; /* non-simple--look up in lists */ |
434 |
r.v.n = d[*p++ - s]; |
|
636 | 435 |
} |
436 |
||
437 |
/* fill code-like entries with r */ |
|
438 |
f = 1 << (k - w); |
|
439 |
for (j = i >> w; j < z; j += f) |
|
1839 | 440 |
q[j] = r; |
636 | 441 |
|
442 |
/* backwards increment the k-bit code i */ |
|
443 |
for (j = 1 << (k - 1); i & j; j >>= 1) |
|
1839 | 444 |
i ^= j; |
636 | 445 |
i ^= j; |
446 |
||
447 |
/* backup over finished tables */ |
|
448 |
while ((i & ((1 << w) - 1)) != x[h]) |
|
1839 | 449 |
w -= l[--h]; /* don't need to update q */ |
636 | 450 |
} |
451 |
} |
|
452 |
||
453 |
||
454 |
/* return actual size of base table */ |
|
455 |
*m = l[0]; |
|
456 |
||
457 |
||
458 |
/* Return true (1) if we were given an incomplete table */ |
|
459 |
return y != 0 && g != 1; |
|
460 |
} |
|
461 |
||
462 |
||
463 |
||
464 |
#ifdef ASM_INFLATECODES |
|
465 |
# define inflate_codes(tl,td,bl,bd) flate_codes(tl,td,bl,bd,(uchar *)slide) |
|
466 |
int flate_codes OF((struct huft *, struct huft *, int, int, uchar *)); |
|
467 |
||
468 |
#else |
|
469 |
||
470 |
/* inflate (decompress) the codes in a deflated (compressed) block. |
|
471 |
Return an error code or zero if it all goes ok. */ |
|
1839 | 472 |
static int |
636 | 473 |
inflate_codes(tl, td, bl, bd) |
474 |
struct huft *tl, *td; /* literal/length and distance decoder tables */ |
|
475 |
int bl, bd; /* number of bits decoded by tl[] and td[] */ |
|
476 |
{ |
|
477 |
register unsigned e; /* table entry flag/number of extra bits */ |
|
478 |
unsigned n, d; /* length and index for copy */ |
|
479 |
unsigned w; /* current window position */ |
|
480 |
struct huft *t; /* pointer to table entry */ |
|
481 |
unsigned ml, md; /* masks for bl and bd bits */ |
|
482 |
register ulong b; /* bit buffer */ |
|
483 |
register unsigned k; /* number of bits in bit buffer */ |
|
484 |
||
485 |
||
486 |
/* make local copies of globals */ |
|
487 |
b = bb; /* initialize bit buffer */ |
|
488 |
k = bk; |
|
489 |
w = wp; /* initialize window position */ |
|
490 |
||
491 |
||
492 |
/* inflate the coded data */ |
|
493 |
ml = mask[bl]; /* precompute masks for speed */ |
|
494 |
md = mask[bd]; |
|
495 |
while (1) /* do until end of block */ |
|
496 |
{ |
|
497 |
NEEDBITS((unsigned)bl) |
|
498 |
if ((e = (t = tl + ((unsigned)b & ml))->e) > 16) |
|
499 |
do { |
|
1839 | 500 |
if (e == 99) |
501 |
return 1; |
|
502 |
DUMPBITS(t->b) |
|
503 |
e -= 16; |
|
504 |
NEEDBITS(e) |
|
636 | 505 |
} while ((e = (t = t->v.t + ((unsigned)b & mask[e]))->e) > 16); |
506 |
DUMPBITS(t->b) |
|
507 |
if (e == 16) /* then it's a literal */ |
|
508 |
{ |
|
509 |
slide[w++] = (uchar)t->v.n; |
|
510 |
if (w == WSIZE) |
|
511 |
{ |
|
1839 | 512 |
FLUSH(w); |
513 |
w = 0; |
|
636 | 514 |
} |
515 |
} |
|
516 |
else /* it's an EOB or a length */ |
|
517 |
{ |
|
518 |
/* exit if end of block */ |
|
519 |
if (e == 15) |
|
1839 | 520 |
break; |
636 | 521 |
|
522 |
/* get length of block to copy */ |
|
523 |
NEEDBITS(e) |
|
524 |
n = t->v.n + ((unsigned)b & mask[e]); |
|
525 |
DUMPBITS(e); |
|
526 |
||
527 |
/* decode distance of block to copy */ |
|
528 |
NEEDBITS((unsigned)bd) |
|
529 |
if ((e = (t = td + ((unsigned)b & md))->e) > 16) |
|
1839 | 530 |
do { |
531 |
if (e == 99) |
|
532 |
return 1; |
|
533 |
DUMPBITS(t->b) |
|
534 |
e -= 16; |
|
535 |
NEEDBITS(e) |
|
536 |
} while ((e = (t = t->v.t + ((unsigned)b & mask[e]))->e) > 16); |
|
636 | 537 |
DUMPBITS(t->b) |
538 |
NEEDBITS(e) |
|
539 |
d = w - t->v.n - ((unsigned)b & mask[e]); |
|
540 |
DUMPBITS(e) |
|
541 |
||
542 |
/* do the copy */ |
|
543 |
do { |
|
1839 | 544 |
n -= (e = (e = WSIZE - ((d &= WSIZE-1) > w ? d : w)) > n ? n : e); |
636 | 545 |
#ifndef NOMEMCPY |
1839 | 546 |
if (w - d >= e) /* (this test assumes unsigned comparison) */ |
547 |
{ |
|
636 | 548 |
# ifdef USE_MEMCPY |
1839 | 549 |
memcpy(slide + w, slide + d, e); |
636 | 550 |
# else |
1839 | 551 |
bcopy(slide + d, slide + w, e); |
636 | 552 |
# endif |
1839 | 553 |
w += e; |
554 |
d += e; |
|
555 |
} |
|
556 |
else /* do it slow to avoid memcpy() overlap */ |
|
636 | 557 |
#endif /* !NOMEMCPY */ |
1839 | 558 |
do { |
559 |
slide[w++] = slide[d++]; |
|
560 |
} while (--e); |
|
561 |
if (w == WSIZE) |
|
562 |
{ |
|
563 |
FLUSH(w); |
|
564 |
w = 0; |
|
565 |
} |
|
636 | 566 |
} while (n); |
567 |
} |
|
568 |
} |
|
569 |
||
570 |
||
571 |
/* restore the globals from the locals */ |
|
572 |
wp = w; /* restore global window pointer */ |
|
573 |
bb = b; /* restore global bit buffer */ |
|
574 |
bk = k; |
|
575 |
||
576 |
||
577 |
/* done */ |
|
578 |
return 0; |
|
579 |
} |
|
580 |
||
581 |
#endif /* ASM_INFLATECODES */ |
|
582 |
||
583 |
||
584 |
||
585 |
/* "decompress" an inflated type 0 (stored) block. */ |
|
1839 | 586 |
static int |
636 | 587 |
inflate_stored() |
588 |
{ |
|
589 |
unsigned n; /* number of bytes in block */ |
|
590 |
unsigned w; /* current window position */ |
|
591 |
register ulong b; /* bit buffer */ |
|
592 |
register unsigned k; /* number of bits in bit buffer */ |
|
593 |
||
594 |
||
595 |
/* make local copies of globals */ |
|
596 |
Trace((stderr, "stored block\n")); |
|
597 |
b = bb; /* initialize bit buffer */ |
|
598 |
k = bk; |
|
599 |
w = wp; /* initialize window position */ |
|
600 |
||
601 |
||
602 |
/* go to byte boundary */ |
|
603 |
n = k & 7; |
|
604 |
DUMPBITS(n); |
|
605 |
||
606 |
||
607 |
/* get the length and its complement */ |
|
608 |
NEEDBITS(16) |
|
609 |
n = ((unsigned)b & 0xffff); |
|
610 |
DUMPBITS(16) |
|
611 |
NEEDBITS(16) |
|
612 |
if (n != (unsigned)((~b) & 0xffff)) |
|
613 |
return 1; /* error in compressed data */ |
|
614 |
DUMPBITS(16) |
|
615 |
||
616 |
||
617 |
/* read and output the compressed data */ |
|
618 |
while (n--) |
|
619 |
{ |
|
620 |
NEEDBITS(8) |
|
621 |
slide[w++] = (uchar)b; |
|
622 |
if (w == WSIZE) |
|
623 |
{ |
|
624 |
FLUSH(w); |
|
625 |
w = 0; |
|
626 |
} |
|
627 |
DUMPBITS(8) |
|
628 |
} |
|
629 |
||
630 |
||
631 |
/* restore the globals from the locals */ |
|
632 |
wp = w; /* restore global window pointer */ |
|
633 |
bb = b; /* restore global bit buffer */ |
|
634 |
bk = k; |
|
635 |
return 0; |
|
636 |
} |
|
637 |
||
638 |
||
639 |
/* Globals for literal tables (built once) */ |
|
640 |
static struct huft *fixed_tl = (struct huft *)NULL; |
|
641 |
static struct huft *fixed_td = (struct huft *)NULL; |
|
642 |
static int fixed_bl, fixed_bd; |
|
643 |
||
644 |
/* decompress an inflated type 1 (fixed Huffman codes) block. We should |
|
645 |
either replace this with a custom decoder, or at least precompute the |
|
646 |
Huffman tables. */ |
|
1839 | 647 |
static int |
636 | 648 |
inflate_fixed() |
649 |
{ |
|
650 |
/* if first time, set up tables for fixed blocks */ |
|
651 |
Trace((stderr, "fixed block\n")); |
|
652 |
if (fixed_tl == (struct huft *)NULL) |
|
653 |
{ |
|
654 |
int i; /* temporary variable */ |
|
655 |
static unsigned l[288]; /* length list for huft_build */ |
|
656 |
||
657 |
/* literal table */ |
|
658 |
for (i = 0; i < 144; i++) |
|
659 |
l[i] = 8; |
|
660 |
for (; i < 256; i++) |
|
661 |
l[i] = 9; |
|
662 |
for (; i < 280; i++) |
|
663 |
l[i] = 7; |
|
664 |
for (; i < 288; i++) /* make a complete, but wrong code set */ |
|
665 |
l[i] = 8; |
|
666 |
fixed_bl = 7; |
|
667 |
if ((i = huft_build(l, 288, 257, cplens, cplext, |
|
1839 | 668 |
&fixed_tl, &fixed_bl)) != 0) |
636 | 669 |
{ |
670 |
Trace((stderr, "incomplete code set 1\n")); |
|
671 |
fixed_tl = (struct huft *)NULL; |
|
672 |
return i; |
|
673 |
} |
|
674 |
||
675 |
/* distance table */ |
|
676 |
for (i = 0; i < 30; i++) /* make an incomplete code set */ |
|
677 |
l[i] = 5; |
|
678 |
fixed_bd = 5; |
|
679 |
if ((i = huft_build(l, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd)) > 1) |
|
680 |
{ |
|
681 |
Trace((stderr, "incomplete code set 2\n")); |
|
682 |
huft_free(fixed_tl); |
|
683 |
fixed_tl = (struct huft *)NULL; |
|
684 |
return i; |
|
685 |
} |
|
686 |
} |
|
687 |
||
688 |
||
689 |
/* decompress until an end-of-block code */ |
|
690 |
return inflate_codes(fixed_tl, fixed_td, fixed_bl, fixed_bd) != 0; |
|
691 |
} |
|
692 |
||
693 |
||
694 |
||
695 |
/* decompress an inflated type 2 (dynamic Huffman codes) block. */ |
|
1839 | 696 |
static int |
636 | 697 |
inflate_dynamic() |
698 |
{ |
|
699 |
int i; /* temporary variables */ |
|
700 |
unsigned j; |
|
701 |
unsigned l; /* last length */ |
|
702 |
unsigned m; /* mask for bit lengths table */ |
|
703 |
unsigned n; /* number of lengths to get */ |
|
704 |
struct huft *tl; /* literal/length code table */ |
|
705 |
struct huft *td; /* distance code table */ |
|
706 |
int bl; /* lookup bits for tl */ |
|
707 |
int bd; /* lookup bits for td */ |
|
708 |
unsigned nb; /* number of bit length codes */ |
|
709 |
unsigned nl; /* number of literal/length codes */ |
|
710 |
unsigned nd; /* number of distance codes */ |
|
711 |
#ifdef PKZIP_BUG_WORKAROUND |
|
712 |
static unsigned ll[288+32]; /* literal/length and distance code lengths */ |
|
713 |
#else |
|
714 |
static unsigned ll[286+30]; /* literal/length and distance code lengths */ |
|
715 |
#endif |
|
716 |
register ulong b; /* bit buffer */ |
|
717 |
register unsigned k; /* number of bits in bit buffer */ |
|
718 |
||
719 |
||
720 |
/* make local bit buffer */ |
|
721 |
Trace((stderr, "dynamic block\n")); |
|
722 |
b = bb; |
|
723 |
k = bk; |
|
724 |
||
725 |
||
726 |
/* read in table lengths */ |
|
727 |
NEEDBITS(5) |
|
728 |
nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ |
|
729 |
DUMPBITS(5) |
|
730 |
NEEDBITS(5) |
|
731 |
nd = 1 + ((unsigned)b & 0x1f); /* number of distance codes */ |
|
732 |
DUMPBITS(5) |
|
733 |
NEEDBITS(4) |
|
734 |
nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ |
|
735 |
DUMPBITS(4) |
|
736 |
#ifdef PKZIP_BUG_WORKAROUND |
|
737 |
if (nl > 288 || nd > 32) |
|
738 |
#else |
|
739 |
if (nl > 286 || nd > 30) |
|
740 |
#endif |
|
741 |
{ |
|
742 |
Trace((stderr, "bad length\n")); |
|
743 |
return 1; /* bad lengths */ |
|
744 |
} |
|
745 |
||
746 |
||
747 |
/* read in bit-length-code lengths */ |
|
748 |
for (j = 0; j < nb; j++) |
|
749 |
{ |
|
750 |
NEEDBITS(3) |
|
751 |
ll[border[j]] = (unsigned)b & 7; |
|
752 |
DUMPBITS(3) |
|
753 |
} |
|
754 |
for (; j < 19; j++) |
|
755 |
ll[border[j]] = 0; |
|
756 |
||
757 |
||
758 |
/* build decoding table for trees--single level, 7 bit lookup */ |
|
759 |
bl = 7; |
|
760 |
if ((i = huft_build(ll, 19, 19, NULL, NULL, &tl, &bl)) != 0) |
|
761 |
{ |
|
762 |
if (i == 1) |
|
763 |
huft_free(tl); |
|
764 |
Trace((stderr, "incomplete code set 3\n")); |
|
765 |
return i; /* incomplete code set */ |
|
766 |
} |
|
767 |
||
768 |
||
769 |
/* read in literal and distance code lengths */ |
|
770 |
n = nl + nd; |
|
771 |
m = mask[bl]; |
|
772 |
i = l = 0; |
|
773 |
while ((unsigned)i < n) |
|
774 |
{ |
|
775 |
NEEDBITS((unsigned)bl) |
|
776 |
j = (td = tl + ((unsigned)b & m))->b; |
|
777 |
DUMPBITS(j) |
|
778 |
j = td->v.n; |
|
779 |
if (j < 16) /* length of code in bits (0..15) */ |
|
780 |
ll[i++] = l = j; /* save last length in l */ |
|
781 |
else if (j == 16) /* repeat last length 3 to 6 times */ |
|
782 |
{ |
|
783 |
NEEDBITS(2) |
|
784 |
j = 3 + ((unsigned)b & 3); |
|
785 |
DUMPBITS(2) |
|
786 |
if ((unsigned)i + j > n) |
|
1839 | 787 |
return 1; |
636 | 788 |
while (j--) |
1839 | 789 |
ll[i++] = l; |
636 | 790 |
} |
791 |
else if (j == 17) /* 3 to 10 zero length codes */ |
|
792 |
{ |
|
793 |
NEEDBITS(3) |
|
794 |
j = 3 + ((unsigned)b & 7); |
|
795 |
DUMPBITS(3) |
|
796 |
if ((unsigned)i + j > n) |
|
1839 | 797 |
return 1; |
636 | 798 |
while (j--) |
1839 | 799 |
ll[i++] = 0; |
636 | 800 |
l = 0; |
801 |
} |
|
802 |
else /* j == 18: 11 to 138 zero length codes */ |
|
803 |
{ |
|
804 |
NEEDBITS(7) |
|
805 |
j = 11 + ((unsigned)b & 0x7f); |
|
806 |
DUMPBITS(7) |
|
807 |
if ((unsigned)i + j > n) |
|
1839 | 808 |
return 1; |
636 | 809 |
while (j--) |
1839 | 810 |
ll[i++] = 0; |
636 | 811 |
l = 0; |
812 |
} |
|
813 |
} |
|
814 |
||
815 |
||
816 |
/* free decoding table for trees */ |
|
817 |
huft_free(tl); |
|
818 |
||
819 |
||
820 |
/* restore the global bit buffer */ |
|
821 |
bb = b; |
|
822 |
bk = k; |
|
823 |
||
824 |
||
825 |
/* build the decoding tables for literal/length and distance codes */ |
|
826 |
bl = lbits; |
|
827 |
if ((i = huft_build(ll, nl, 257, cplens, cplext, &tl, &bl)) != 0) |
|
828 |
{ |
|
829 |
Trace((stderr, "incomplete code set 4\n")); |
|
830 |
if (i == 1 && !qflag) { |
|
831 |
Trace((stderr, "incomplete l-tree\n")); |
|
832 |
huft_free(tl); |
|
833 |
} |
|
834 |
return i; /* incomplete code set */ |
|
835 |
} |
|
836 |
bd = dbits; |
|
837 |
if ((i = huft_build(ll + nl, nd, 0, cpdist, cpdext, &td, &bd)) != 0) |
|
838 |
{ |
|
839 |
Trace((stderr, "huft_build err\n")); |
|
840 |
if (i == 1 && !qflag) { |
|
841 |
Trace((stderr, "incomplete d-tree\n")); |
|
842 |
#ifdef PKZIP_BUG_WORKAROUND |
|
843 |
i = 0; |
|
844 |
} |
|
845 |
#else |
|
846 |
huft_free(td); |
|
847 |
} |
|
848 |
huft_free(tl); |
|
849 |
return i; /* incomplete code set */ |
|
850 |
#endif |
|
851 |
} |
|
852 |
||
853 |
||
854 |
/* decompress until an end-of-block code */ |
|
855 |
if (inflate_codes(tl, td, bl, bd)) { |
|
856 |
Trace((stderr, "inflate_codes error\n")); |
|
857 |
return 1; |
|
858 |
} |
|
859 |
||
860 |
||
861 |
/* free the decoding tables, return */ |
|
862 |
huft_free(tl); |
|
863 |
huft_free(td); |
|
864 |
Trace((stderr, "block ok\n")); |
|
865 |
return 0; |
|
866 |
} |
|
867 |
||
868 |
||
869 |
||
870 |
/* decompress an inflated block */ |
|
1839 | 871 |
static int |
637 | 872 |
inflate_block(endPtr) |
873 |
int *endPtr; /* last block flag */ |
|
636 | 874 |
{ |
875 |
unsigned t; /* block type */ |
|
876 |
register ulong b; /* bit buffer */ |
|
877 |
register unsigned k; /* number of bits in bit buffer */ |
|
878 |
||
879 |
||
637 | 880 |
Trace((stderr, "inflate_block\n")); |
881 |
||
636 | 882 |
/* make local bit buffer */ |
883 |
b = bb; |
|
884 |
k = bk; |
|
885 |
||
886 |
||
887 |
/* read in last block bit */ |
|
888 |
NEEDBITS(1) |
|
637 | 889 |
*endPtr = (int)b & 1; |
890 |
Trace((stderr, " end = %d\n", (int)b & 1)); |
|
891 |
||
636 | 892 |
DUMPBITS(1) |
893 |
||
894 |
||
895 |
/* read in block type */ |
|
896 |
NEEDBITS(2) |
|
897 |
t = (unsigned)b & 3; |
|
898 |
DUMPBITS(2) |
|
637 | 899 |
Trace((stderr, " type = %d\n", t)); |
636 | 900 |
|
901 |
||
902 |
/* restore the global bit buffer */ |
|
903 |
bb = b; |
|
904 |
bk = k; |
|
905 |
||
906 |
||
907 |
/* inflate that block type */ |
|
637 | 908 |
if (t == 2) { |
636 | 909 |
return inflate_dynamic(); |
637 | 910 |
} |
911 |
if (t == 0) { |
|
636 | 912 |
return inflate_stored(); |
637 | 913 |
} |
914 |
if (t == 1) { |
|
636 | 915 |
return inflate_fixed(); |
637 | 916 |
} |
636 | 917 |
|
918 |
Trace((stderr, "bad block type\n")); |
|
919 |
/* bad block type */ |
|
920 |
return 2; |
|
921 |
} |
|
922 |
||
923 |
||
924 |
||
925 |
/* decompress an inflated entry */ |
|
1839 | 926 |
static int |
636 | 927 |
inflate() |
928 |
{ |
|
637 | 929 |
int endFlag; /* last block flag */ |
636 | 930 |
int r; /* result code */ |
931 |
unsigned h; /* maximum struct huft's malloc'ed */ |
|
932 |
||
933 |
/* initialize window, bit buffer */ |
|
934 |
wp = 0; |
|
935 |
bk = 0; |
|
936 |
bb = 0; |
|
937 |
||
637 | 938 |
endFlag = 0; |
636 | 939 |
|
940 |
/* decompress until the last block */ |
|
941 |
h = 0; |
|
942 |
do { |
|
943 |
hufts = 0; |
|
637 | 944 |
if ((r = inflate_block(&endFlag)) != 0) { |
945 |
Trace((stderr, "inflate_block -> %d\n", r)); |
|
636 | 946 |
return r; |
637 | 947 |
} |
636 | 948 |
if (hufts > h) |
949 |
h = hufts; |
|
637 | 950 |
} while (!endFlag); |
636 | 951 |
|
952 |
||
953 |
/* flush out slide */ |
|
954 |
FLUSH(wp); |
|
955 |
||
956 |
||
957 |
/* return success */ |
|
958 |
Trace((stderr, "%u bytes in Huffman tables (%d/entry)\n", |
|
1839 | 959 |
h * sizeof(struct huft), sizeof(struct huft))); |
636 | 960 |
return 0; |
961 |
} |
|
962 |
||
963 |
||
964 |
||
1839 | 965 |
static int |
636 | 966 |
inflate_free() |
967 |
{ |
|
968 |
if (fixed_td != (struct huft *)NULL) |
|
969 |
{ |
|
970 |
huft_free(fixed_td); |
|
971 |
fixed_td = (struct huft *)NULL; |
|
972 |
} |
|
973 |
||
974 |
if (fixed_tl != (struct huft *)NULL) |
|
975 |
{ |
|
976 |
huft_free(fixed_tl); |
|
977 |
fixed_tl = (struct huft *)NULL; |
|
978 |
} |
|
979 |
return 0; |
|
980 |
} |
|
981 |
||
982 |
||
1839 | 983 |
static int |
636 | 984 |
stx_inflate(in, out) |
985 |
char *in, *out; |
|
986 |
{ |
|
987 |
int rslt; |
|
1749 | 988 |
extern void *malloc(); |
636 | 989 |
|
990 |
inPtr = in; |
|
991 |
outPtr = out; |
|
1564 | 992 |
slide = malloc(WSIZE+2); |
637 | 993 |
if (! slide) return 1; |
636 | 994 |
|
995 |
rslt = inflate(); |
|
996 |
inflate_free(); |
|
637 | 997 |
free(slide); |
636 | 998 |
return rslt; |
999 |
} |
|
1000 |
||
1001 |
%} |
|
1002 |
! ! |
|
1003 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1004 |
!ZipArchive class methodsFor:'documentation'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1005 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1006 |
copyright |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1007 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1008 |
COPYRIGHT (c) 1998 by eXept Software AG |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1009 |
All Rights Reserved |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1010 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1011 |
This software is furnished under a license and may be used |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1012 |
only in accordance with the terms of that license and with the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1013 |
inclusion of the above copyright notice. This software may not |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1014 |
be provided or otherwise made available to, or used by, any |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1015 |
other person. No title to or ownership of the software is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1016 |
hereby transferred. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1017 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1018 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1019 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1020 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1021 |
documentation |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1022 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1023 |
provides access to a zip archive. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1024 |
Caveat: the only compression method (for now) is deflate. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1025 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1026 |
[author:] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1027 |
Claus Gittinger |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1028 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1029 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1030 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1031 |
examples |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1032 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1033 |
[exBegin] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1034 |
|zip bytes| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1035 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1036 |
zip := ZipArchive oldFileNamed:'foo.zip'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1037 |
bytes := zip extract:'bar'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1038 |
zip closeFile. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1039 |
[exEnd] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1040 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1041 |
[exBegin] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1042 |
|zip bytes| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1043 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1044 |
zip := ZipArchive oldFileNamed:'source/stx/libbasic2.zip'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1045 |
zip entries do:[:entry | |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1046 |
Transcript showCR:entry |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1047 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1048 |
zip closeFile. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1049 |
[exEnd] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1050 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1051 |
[exBegin] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1052 |
|zip bytes| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1053 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1054 |
zip := ZipArchive oldFileNamed:'source/stx/libbasic2.zip'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1055 |
bytes := zip extract:'TwoByteStr.st'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1056 |
zip closeFile. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1057 |
Transcript showCR:(bytes asString). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1058 |
[exEnd] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1059 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1060 |
|
1993 | 1061 |
compatibility write check with winzip (compressed with deflate) |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1062 |
[exBegin] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1063 |
|zipwr testDirectory testFileWr| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1064 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1065 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1066 |
testFileWr := 'crcTest_resume_compressed.zip'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1067 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1068 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1069 |
zipwr addFile:'crcTest_resume_compressed.txt' withContents: 'resume'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1070 |
zipwr closeFile. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1071 |
[exEnd] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1072 |
|
1993 | 1073 |
compatibility read check with winzip (compressed with deflate) |
1074 |
[exBegin] |
|
1075 |
|ziprd testDirectory testFileRd contents| |
|
1076 |
||
1077 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
|
1078 |
testFileRd := 'crcTest_resume_compressed.zip'. |
|
1079 |
||
1080 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
|
1081 |
contents := ziprd extract: ziprd entries first. |
|
1082 |
contents inspect. |
|
1083 |
ziprd closeFile. |
|
1084 |
[exEnd] |
|
1085 |
||
1086 |
compatibility write check with winzip (uncompressed) |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1087 |
[exBegin] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1088 |
|zipwr testDirectory testFileWr| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1089 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1090 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1091 |
testFileWr := 'crcTest_resume_uncompressed.zip'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1092 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1093 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1094 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1095 |
zipwr addFile:'crcTest_resume_uncompressed.txt' |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1096 |
withContents:'resume' |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1097 |
compressMethod:0 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1098 |
asDirectory:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1099 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1100 |
zipwr closeFile. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1101 |
[exEnd] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1102 |
|
1993 | 1103 |
compatibility read check with winzip (uncompressed) |
1104 |
[exBegin] |
|
1105 |
|ziprd testDirectory testFileRd contents| |
|
1106 |
||
1107 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
|
1108 |
testFileRd := 'crcTest_resume_uncompressed.zip'. |
|
1109 |
||
1110 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
|
1111 |
contents := ziprd extract: ziprd entries first. |
|
1112 |
contents inspect. |
|
1113 |
ziprd closeFile. |
|
1114 |
[exEnd] |
|
1115 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1116 |
read an archive with files and/or directories, fetch the entries |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1117 |
and create a new archive with the same content |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1118 |
[exBegin] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1119 |
|ziprd zipwr entryDict testDirectory testFileRd testFileWr| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1120 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1121 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1122 |
testFileRd := 'projects.zip'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1123 |
testFileWr := 'projects_expecco_test.zip'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1124 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1125 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1126 |
entryDict := Dictionary new. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1127 |
ziprd entries do: [:aFileName| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1128 |
entryDict at:aFileName put:(ziprd extract: aFileName) asString. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1129 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1130 |
ziprd closeFile. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1131 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1132 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1133 |
entryDict keysAndValuesDo: [:key :value| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1134 |
(value size == 0) ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1135 |
zipwr addDirectory:key. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1136 |
] ifFalse: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1137 |
zipwr addFile:key withContents:value |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1138 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1139 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1140 |
zipwr closeFile. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1141 |
[exEnd] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1142 |
|
1994 | 1143 |
[exBegin] |
1993 | 1144 |
|zipwr ziprd testDirectory testFileWr testFileRd zs| |
1145 |
||
1146 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
|
1147 |
testFileWr := 'crcTest_resume_compressed.zip'. |
|
1148 |
||
1149 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
|
1150 |
zipwr addFile:'crcTest_resume_compressed.txt' withContents: 'Das ist ein test, das ist ein test, das ist ein test'. |
|
1151 |
zipwr close. |
|
1152 |
||
1153 |
testFileRd := 'crcTest_resume_compressed.zip'. |
|
1154 |
||
1155 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
|
1156 |
zs := ziprd readStreamFor: 'crcTest_resume_compressed.txt'. |
|
1157 |
zs inspect. |
|
1158 |
ziprd close. |
|
1994 | 1159 |
[exEnd] |
1160 |
||
1161 |
[exBegin] |
|
1993 | 1162 |
|zipwr ziprd testDirectory testFileWr testFileRd rs result| |
1163 |
||
1164 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
|
1165 |
testFileWr := 'readStreamTest_HelloWorld.zip'. |
|
1166 |
||
1167 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
|
1168 |
zipwr addFile:'readStreamTest_HelloWorld.txt' withContents: 'Hello World!!' compressed: false. |
|
1169 |
zipwr close. |
|
1170 |
||
1171 |
testFileRd := 'readStreamTest_HelloWorld.zip'. |
|
1172 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
|
1173 |
rs := ziprd readStreamFor: 'readStreamTest_HelloWorld.txt'. |
|
1174 |
||
1175 |
result := ''. |
|
1176 |
[ rs atEnd ] whileFalse: [ |
|
1177 |
result := result, (rs nextAvailable:5). |
|
1178 |
]. |
|
1179 |
result inspect. |
|
1180 |
rs close. |
|
1181 |
ziprd close. |
|
1994 | 1182 |
[exEnd] |
1183 |
||
1184 |
read an archive with files and/or directories and/or zipArchives, |
|
1185 |
fetch the entries (also from the include zip archives) |
|
1186 |
and create a new archive |
|
1187 |
[exBegin] |
|
1188 |
|ziprd zipwr entryDict testDirectory testFileRd testFileWr zipRdSub1 zipRdSub2| |
|
1189 |
||
1190 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
|
1191 |
testFileRd := 'ZipInZipFileTest.zip'. |
|
1192 |
testFileWr := 'ZipInZipFileTest_generated.zip'. |
|
1193 |
||
1194 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
|
1195 |
entryDict := Dictionary new. |
|
1196 |
ziprd entries do: [:aFileName| |
|
1197 |
Transcript showCR: 'processing in top: ', aFileName. |
|
1198 |
(aFileName endsWith:'.zip') ifTrue: [ |
|
1199 |
zipRdSub1 := ziprd extractArchive: aFileName. |
|
1200 |
zipRdSub1 entries do: [:aFileName1| |
|
1201 |
Transcript showCR: 'processing in sub 1: ', aFileName1. |
|
1202 |
(aFileName1 endsWith:'.zip') ifTrue: [ |
|
1203 |
zipRdSub2 := zipRdSub1 extractArchive: aFileName1. |
|
1204 |
zipRdSub2 entries do: [:aFileName2| |
|
1205 |
Transcript showCR: 'processing in sub 2: ', aFileName2. |
|
1206 |
(aFileName2 endsWith:'.zip') ifTrue: [ |
|
1207 |
self halt. |
|
1208 |
] ifFalse: [ |
|
1209 |
entryDict at:aFileName2 put:(zipRdSub2 extract: aFileName2) asString. |
|
1210 |
]. |
|
1211 |
]. |
|
1212 |
zipRdSub2 closeFile. |
|
1213 |
] ifFalse: [ |
|
1214 |
entryDict at:aFileName1 put:(zipRdSub1 extract: aFileName1) asString. |
|
1215 |
]. |
|
1216 |
]. |
|
1217 |
zipRdSub1 closeFile. |
|
1218 |
] ifFalse: [ |
|
1219 |
entryDict at:aFileName put:(ziprd extract: aFileName) asString. |
|
1220 |
]. |
|
1221 |
]. |
|
1222 |
ziprd closeFile. |
|
1223 |
||
1224 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
|
1225 |
entryDict keysAndValuesDo: [:key :value| |
|
1226 |
(value size == 0) ifTrue: [ |
|
1227 |
zipwr addDirectory:key. |
|
1228 |
] ifFalse: [ |
|
1229 |
zipwr addFile:key withContents:value |
|
1230 |
]. |
|
1231 |
]. |
|
1232 |
zipwr closeFile. |
|
1233 |
[exEnd] |
|
1234 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1235 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1236 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1237 |
|
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1238 |
examples2 |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1239 |
" |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1240 |
add to new zip archive a entry which is located in memory using selector |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1241 |
addFile:'crcTest_resume_compressed.txt' withContents: |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1242 |
and real file contents from disk (uncompressed) identified by a readStream using selector |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1243 |
addFile:rdStreamFile fromStream: |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1244 |
[exBegin] |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1245 |
|zipwr testDirectory testFileWr rdStreamFile rdFileStream | |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1246 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1247 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1248 |
testFileWr := 'streamtest_uncompressed.zip'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1249 |
rdStreamFile := 'projects.zip'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1250 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1251 |
rdFileStream := ('C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\', rdStreamFile) asFilename readStream. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1252 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1253 |
zipwr addFile:'crcTest_resume_compressed.txt' withContents: 'resume'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1254 |
zipwr addFile:rdStreamFile fromStream: rdFileStream. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1255 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1256 |
zipwr closeFile. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1257 |
[exEnd] |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1258 |
|
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1259 |
read from zip archive a entry into memory using selector |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1260 |
extract:'crcTest_resume_compressed.txt' |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1261 |
and store an uncompressed archive entry to disk using a writeStream |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1262 |
extract: intoStream: |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1263 |
[exBegin] |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1264 |
|ziprd testDirectory testFileRd wrStreamFile wrFileStream data1| |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1265 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1266 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1267 |
testFileRd := 'streamtest_uncompressed.zip'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1268 |
wrStreamFile := 'test_projects.zip'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1269 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1270 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1271 |
data1 := ziprd extract:'crcTest_resume_compressed.txt'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1272 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1273 |
wrFileStream := ('C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\', wrStreamFile) asFilename writeStream. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1274 |
(ziprd extract:'projects.zip' intoStream: wrFileStream) ifFalse: [ |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1275 |
self halt. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1276 |
]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1277 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1278 |
ziprd closeFile. |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1279 |
wrFileStream close. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1280 |
[exEnd] |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1281 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1282 |
add (compressed) to new zip archive a real file contents from disk e.g. a pdf |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1283 |
identified by a readStream |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1284 |
using selector |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1285 |
addFile: fromStream: compressMethod: |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1286 |
[exBegin] |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1287 |
|zipwr testDirectory testFileWr rdStreamFile rdFileStream| |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1288 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1289 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1290 |
testFileWr := 'streamtest_compressed.zip'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1291 |
rdStreamFile := 'test.pdf'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1292 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1293 |
rdFileStream := ('C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\', rdStreamFile) asFilename readStream. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1294 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1295 |
zipwr addFileCompressed:rdStreamFile fromStream: rdFileStream. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1296 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1297 |
zipwr closeFile. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1298 |
[exEnd] |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1299 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1300 |
read from zip archive a compressed entry e.g. a pdf and store the contents |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1301 |
to disk using a readStream |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1302 |
using selector |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1303 |
readStreamFor: rdStreamFile |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1304 |
[exBegin] |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1305 |
|ziprd testDirectory testFileRd wrStreamFile wrFileStream| |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1306 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1307 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1308 |
testFileRd := 'streamtest_compressed.zip'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1309 |
wrStreamFile := 'test_expecco.pdf'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1310 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1311 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1312 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1313 |
wrFileStream := ('C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\', wrStreamFile) asFilename writeStream. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1314 |
(ziprd extract:'test.pdf' intoStream: wrFileStream) ifFalse: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1315 |
self halt. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1316 |
]. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1317 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1318 |
ziprd closeFile. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1319 |
wrFileStream close. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1320 |
[exEnd] |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1321 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1322 |
" |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1323 |
! |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
1324 |
|
2003 | 1325 |
examples3 |
1326 |
" |
|
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1327 |
add to new zip archive recursive the contents of a directory (uncompressed) |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1328 |
addArchiveDirectory: fromOsDirectory: |
2003 | 1329 |
[exBegin] |
1330 |
|zipwr testDirectory testFileWr zipDirectory | |
|
1331 |
||
1332 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
|
1333 |
testFileWr := 'zipDirectoryTest.zip'. |
|
1334 |
zipDirectory := 'abc'. |
|
1335 |
||
1336 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
|
1337 |
||
1338 |
zipwr addArchiveDirectory: 'attachments' fromOsDirectory: (testDirectory,zipDirectory). |
|
1339 |
||
1340 |
zipwr closeFile. |
|
1341 |
[exEnd] |
|
1342 |
||
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1343 |
read from zip archive all entries which are stored in an archive directory (uncompressed) |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1344 |
and store all those entries in a directory on the file system |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1345 |
restoreOsDirectory: fromArchiveDirectory: |
2003 | 1346 |
[exBegin] |
1347 |
|ziprd testDirectory testFileRd zipDirectory| |
|
1348 |
||
1349 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
|
1350 |
testFileRd := 'zipDirectoryTest.zip'. |
|
1351 |
zipDirectory := 'xxx'. |
|
1352 |
||
1353 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
|
1354 |
ziprd restoreOsDirectory: (testDirectory,zipDirectory) fromArchiveDirectory: 'attachments'. |
|
1355 |
ziprd closeFile. |
|
1356 |
[exEnd] |
|
1357 |
||
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1358 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1359 |
add to new zip archive recursive the contents of a directory (compressed) |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1360 |
addArchiveDirectoryCompressed: fromOsDirectory: |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1361 |
[exBegin] |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1362 |
|zipwr testDirectory testFileWr zipDirectory | |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1363 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1364 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1365 |
testFileWr := 'zipDirectoryTestCompressed.zip'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1366 |
zipDirectory := 'abc'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1367 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1368 |
zipwr := ZipArchive newFileNamed:(testDirectory, testFileWr). |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1369 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1370 |
zipwr addArchiveDirectoryCompressed: 'attachments' fromOsDirectory: (testDirectory,zipDirectory). |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1371 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1372 |
zipwr closeFile. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1373 |
[exEnd] |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1374 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1375 |
read from zip archive all entries which are stored in an archive directory (compressed) |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1376 |
and store all those entries in a directory on the file system |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1377 |
restoreOsDirectory: fromArchiveDirectory: |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1378 |
[exBegin] |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1379 |
|ziprd testDirectory testFileRd zipDirectory| |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1380 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1381 |
testDirectory := 'C:\Dokumente und Einstellungen\stefan\Eigene Dateien\tmp\'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1382 |
testFileRd := 'zipDirectoryTestCompressed.zip'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1383 |
zipDirectory := 'xxx-compressed'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1384 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1385 |
ziprd := ZipArchive oldFileNamed:(testDirectory, testFileRd). |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1386 |
ziprd restoreOsDirectory: (testDirectory,zipDirectory) fromArchiveDirectory: 'attachments'. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1387 |
ziprd closeFile. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1388 |
[exEnd] |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
1389 |
|
2003 | 1390 |
" |
1391 |
! |
|
1392 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1393 |
fileFormatDescription |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1394 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1395 |
"/File: APPNOTE.TXT - .ZIP File Format Specification |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1396 |
"/Version: 6.3.2 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1397 |
"/Revised: September 28, 2007 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1398 |
"/Copyright (c) 1989 - 2007 PKWARE Inc., All Rights Reserved. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1399 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1400 |
"/The use of certain technological aspects disclosed in the current |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1401 |
"/APPNOTE is available pursuant to the below section entitled |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1402 |
"/"Incorporating PKWARE Proprietary Technology into Your Product". |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1403 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1404 |
"/I. Purpose |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1405 |
"/---------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1406 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1407 |
"/This specification is intended to define a cross-platform, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1408 |
"/interoperable file storage and transfer format. Since its |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1409 |
"/first publication in 1989, PKWARE has remained committed to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1410 |
"/ensuring the interoperability of the .ZIP file format through |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1411 |
"/publication and maintenance of this specification. We trust that |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1412 |
"/all .ZIP compatible vendors and application developers that have |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1413 |
"/adopted and benefited from this format will share and support |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1414 |
"/this commitment to interoperability. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1415 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1416 |
"/II. Contacting PKWARE |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1417 |
"/--------------------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1418 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1419 |
"/ PKWARE, Inc. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1420 |
"/ 648 N. Plankinton Avenue, Suite 220 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1421 |
"/ Milwaukee, WI 53203 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1422 |
"/ +1-414-289-9788 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1423 |
"/ +1-414-289-9789 FAX |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1424 |
"/ zipformat@pkware.com |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1425 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1426 |
"/III. Disclaimer |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1427 |
"/--------------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1428 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1429 |
"/Although PKWARE will attempt to supply current and accurate |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1430 |
"/information relating to its file formats, algorithms, and the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1431 |
"/subject programs, the possibility of error or omission cannot |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1432 |
"/be eliminated. PKWARE therefore expressly disclaims any warranty |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1433 |
"/that the information contained in the associated materials relating |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1434 |
"/to the subject programs and/or the format of the files created or |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1435 |
"/accessed by the subject programs and/or the algorithms used by |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1436 |
"/the subject programs, or any other matter, is current, correct or |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1437 |
"/accurate as delivered. Any risk of damage due to any possible |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1438 |
"/inaccurate information is assumed by the user of the information. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1439 |
"/Furthermore, the information relating to the subject programs |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1440 |
"/and/or the file formats created or accessed by the subject |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1441 |
"/programs and/or the algorithms used by the subject programs is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1442 |
"/subject to change without notice. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1443 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1444 |
"/If the version of this file is marked as a NOTIFICATION OF CHANGE, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1445 |
"/the content defines an Early Feature Specification (EFS) change |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1446 |
"/to the .ZIP file format that may be subject to modification prior |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1447 |
"/to publication of the Final Feature Specification (FFS). This |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1448 |
"/document may also contain information on Planned Feature |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1449 |
"/Specifications (PFS) defining recognized future extensions. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1450 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1451 |
"/IV. Change Log |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1452 |
"/-------------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1453 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1454 |
"/Version Change Description Date |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1455 |
"/------- ------------------ ---------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1456 |
"/5.2 -Single Password Symmetric Encryption 06/02/2003 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1457 |
"/ storage |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1458 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1459 |
"/6.1.0 -Smartcard compatibility 01/20/2004 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1460 |
"/ -Documentation on certificate storage |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1461 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1462 |
"/6.2.0 -Introduction of Central Directory 04/26/2004 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1463 |
"/ Encryption for encrypting metadata |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1464 |
"/ -Added OS/X to Version Made By values |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1465 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1466 |
"/6.2.1 -Added Extra Field placeholder for 04/01/2005 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1467 |
"/ POSZIP using ID 0x4690 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1468 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1469 |
"/ -Clarified size field on |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1470 |
"/ "zip64 end of central directory record" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1471 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1472 |
"/6.2.2 -Documented Final Feature Specification 01/06/2006 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1473 |
"/ for Strong Encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1474 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1475 |
"/ -Clarifications and typographical |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1476 |
"/ corrections |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1477 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1478 |
"/6.3.0 -Added tape positioning storage 09/29/2006 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1479 |
"/ parameters |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1480 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1481 |
"/ -Expanded list of supported hash algorithms |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1482 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1483 |
"/ -Expanded list of supported compression |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1484 |
"/ algorithms |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1485 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1486 |
"/ -Expanded list of supported encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1487 |
"/ algorithms |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1488 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1489 |
"/ -Added option for Unicode filename |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1490 |
"/ storage |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1491 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1492 |
"/ -Clarifications for consistent use |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1493 |
"/ of Data Descriptor records |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1494 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1495 |
"/ -Added additional "Extra Field" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1496 |
"/ definitions |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1497 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1498 |
"/6.3.1 -Corrected standard hash values for 04/11/2007 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1499 |
"/ SHA-256/384/512 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1500 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1501 |
"/6.3.2 -Added compression method 97 09/28/2007 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1502 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1503 |
"/ -Documented InfoZIP "Extra Field" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1504 |
"/ values for UTF-8 file name and |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1505 |
"/ file comment storage |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1506 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1507 |
"/V. General Format of a .ZIP file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1508 |
"/-------------------------------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1509 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1510 |
"/ Files stored in arbitrary order. Large .ZIP files can span multiple |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1511 |
"/ volumes or be split into user-defined segment sizes. All values |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1512 |
"/ are stored in little-endian byte order unless otherwise specified. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1513 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1514 |
"/ Overall .ZIP file format: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1515 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1516 |
"/ [local file header 1] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1517 |
"/ [file data 1] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1518 |
"/ [data descriptor 1] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1519 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1520 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1521 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1522 |
"/ [local file header n] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1523 |
"/ [file data n] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1524 |
"/ [data descriptor n] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1525 |
"/ [archive decryption header] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1526 |
"/ [archive extra data record] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1527 |
"/ [central directory] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1528 |
"/ [zip64 end of central directory record] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1529 |
"/ [zip64 end of central directory locator] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1530 |
"/ [end of central directory record] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1531 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1532 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1533 |
"/ A. Local file header: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1534 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1535 |
"/ local file header signature 4 bytes (0x04034b50) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1536 |
"/ version needed to extract 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1537 |
"/ general purpose bit flag 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1538 |
"/ compression method 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1539 |
"/ last mod file time 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1540 |
"/ last mod file date 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1541 |
"/ crc-32 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1542 |
"/ compressed size 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1543 |
"/ uncompressed size 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1544 |
"/ file name length 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1545 |
"/ extra field length 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1546 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1547 |
"/ file name (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1548 |
"/ extra field (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1549 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1550 |
"/ B. File data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1551 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1552 |
"/ Immediately following the local header for a file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1553 |
"/ is the compressed or stored data for the file. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1554 |
"/ The series of [local file header][file data][data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1555 |
"/ descriptor] repeats for each file in the .ZIP archive. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1556 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1557 |
"/ C. Data descriptor: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1558 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1559 |
"/ crc-32 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1560 |
"/ compressed size 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1561 |
"/ uncompressed size 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1562 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1563 |
"/ This descriptor exists only if bit 3 of the general |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1564 |
"/ purpose bit flag is set (see below). It is byte aligned |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1565 |
"/ and immediately follows the last byte of compressed data. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1566 |
"/ This descriptor is used only when it was not possible to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1567 |
"/ seek in the output .ZIP file, e.g., when the output .ZIP file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1568 |
"/ was standard output or a non-seekable device. For ZIP64(tm) format |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1569 |
"/ archives, the compressed and uncompressed sizes are 8 bytes each. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1570 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1571 |
"/ When compressing files, compressed and uncompressed sizes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1572 |
"/ should be stored in ZIP64 format (as 8 byte values) when a |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1573 |
"/ files size exceeds 0xFFFFFFFF. However ZIP64 format may be |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1574 |
"/ used regardless of the size of a file. When extracting, if |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1575 |
"/ the zip64 extended information extra field is present for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1576 |
"/ the file the compressed and uncompressed sizes will be 8 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1577 |
"/ byte values. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1578 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1579 |
"/ Although not originally assigned a signature, the value |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1580 |
"/ 0x08074b50 has commonly been adopted as a signature value |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1581 |
"/ for the data descriptor record. Implementers should be |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1582 |
"/ aware that ZIP files may be encountered with or without this |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1583 |
"/ signature marking data descriptors and should account for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1584 |
"/ either case when reading ZIP files to ensure compatibility. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1585 |
"/ When writing ZIP files, it is recommended to include the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1586 |
"/ signature value marking the data descriptor record. When |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1587 |
"/ the signature is used, the fields currently defined for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1588 |
"/ the data descriptor record will immediately follow the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1589 |
"/ signature. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1590 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1591 |
"/ An extensible data descriptor will be released in a future |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1592 |
"/ version of this APPNOTE. This new record is intended to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1593 |
"/ resolve conflicts with the use of this record going forward, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1594 |
"/ and to provide better support for streamed file processing. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1595 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1596 |
"/ When the Central Directory Encryption method is used, the data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1597 |
"/ descriptor record is not required, but may be used. If present, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1598 |
"/ and bit 3 of the general purpose bit field is set to indicate |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1599 |
"/ its presence, the values in fields of the data descriptor |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1600 |
"/ record should be set to binary zeros. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1601 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1602 |
"/ D. Archive decryption header: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1603 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1604 |
"/ The Archive Decryption Header is introduced in version 6.2 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1605 |
"/ of the ZIP format specification. This record exists in support |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1606 |
"/ of the Central Directory Encryption Feature implemented as part of |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1607 |
"/ the Strong Encryption Specification as described in this document. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1608 |
"/ When the Central Directory Structure is encrypted, this decryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1609 |
"/ header will precede the encrypted data segment. The encrypted |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1610 |
"/ data segment will consist of the Archive extra data record (if |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1611 |
"/ present) and the encrypted Central Directory Structure data. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1612 |
"/ The format of this data record is identical to the Decryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1613 |
"/ header record preceding compressed file data. If the central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1614 |
"/ directory structure is encrypted, the location of the start of |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1615 |
"/ this data record is determined using the Start of Central Directory |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1616 |
"/ field in the Zip64 End of Central Directory record. Refer to the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1617 |
"/ section on the Strong Encryption Specification for information |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1618 |
"/ on the fields used in the Archive Decryption Header record. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1619 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1620 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1621 |
"/ E. Archive extra data record: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1622 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1623 |
"/ archive extra data signature 4 bytes (0x08064b50) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1624 |
"/ extra field length 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1625 |
"/ extra field data (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1626 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1627 |
"/ The Archive Extra Data Record is introduced in version 6.2 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1628 |
"/ of the ZIP format specification. This record exists in support |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1629 |
"/ of the Central Directory Encryption Feature implemented as part of |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1630 |
"/ the Strong Encryption Specification as described in this document. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1631 |
"/ When present, this record immediately precedes the central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1632 |
"/ directory data structure. The size of this data record will be |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1633 |
"/ included in the Size of the Central Directory field in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1634 |
"/ End of Central Directory record. If the central directory structure |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1635 |
"/ is compressed, but not encrypted, the location of the start of |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1636 |
"/ this data record is determined using the Start of Central Directory |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1637 |
"/ field in the Zip64 End of Central Directory record. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1638 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1639 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1640 |
"/ F. Central directory structure: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1641 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1642 |
"/ [file header 1] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1643 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1644 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1645 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1646 |
"/ [file header n] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1647 |
"/ [digital signature] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1648 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1649 |
"/ File header: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1650 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1651 |
"/ central file header signature 4 bytes (0x02014b50) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1652 |
"/ version made by 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1653 |
"/ version needed to extract 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1654 |
"/ general purpose bit flag 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1655 |
"/ compression method 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1656 |
"/ last mod file time 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1657 |
"/ last mod file date 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1658 |
"/ crc-32 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1659 |
"/ compressed size 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1660 |
"/ uncompressed size 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1661 |
"/ file name length 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1662 |
"/ extra field length 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1663 |
"/ file comment length 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1664 |
"/ disk number start 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1665 |
"/ internal file attributes 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1666 |
"/ external file attributes 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1667 |
"/ relative offset of local header 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1668 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1669 |
"/ file name (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1670 |
"/ extra field (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1671 |
"/ file comment (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1672 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1673 |
"/ Digital signature: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1674 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1675 |
"/ header signature 4 bytes (0x05054b50) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1676 |
"/ size of data 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1677 |
"/ signature data (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1678 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1679 |
"/ With the introduction of the Central Directory Encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1680 |
"/ feature in version 6.2 of this specification, the Central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1681 |
"/ Directory Structure may be stored both compressed and encrypted. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1682 |
"/ Although not required, it is assumed when encrypting the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1683 |
"/ Central Directory Structure, that it will be compressed |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1684 |
"/ for greater storage efficiency. Information on the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1685 |
"/ Central Directory Encryption feature can be found in the section |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1686 |
"/ describing the Strong Encryption Specification. The Digital |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1687 |
"/ Signature record will be neither compressed nor encrypted. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1688 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1689 |
"/ G. Zip64 end of central directory record |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1690 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1691 |
"/ zip64 end of central dir |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1692 |
"/ signature 4 bytes (0x06064b50) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1693 |
"/ size of zip64 end of central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1694 |
"/ directory record 8 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1695 |
"/ version made by 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1696 |
"/ version needed to extract 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1697 |
"/ number of this disk 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1698 |
"/ number of the disk with the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1699 |
"/ start of the central directory 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1700 |
"/ total number of entries in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1701 |
"/ central directory on this disk 8 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1702 |
"/ total number of entries in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1703 |
"/ central directory 8 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1704 |
"/ size of the central directory 8 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1705 |
"/ offset of start of central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1706 |
"/ directory with respect to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1707 |
"/ the starting disk number 8 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1708 |
"/ zip64 extensible data sector (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1709 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1710 |
"/ The value stored into the "size of zip64 end of central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1711 |
"/ directory record" should be the size of the remaining |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1712 |
"/ record and should not include the leading 12 bytes. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1713 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1714 |
"/ Size = SizeOfFixedFields + SizeOfVariableData - 12. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1715 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1716 |
"/ The above record structure defines Version 1 of the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1717 |
"/ zip64 end of central directory record. Version 1 was |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1718 |
"/ implemented in versions of this specification preceding |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1719 |
"/ 6.2 in support of the ZIP64 large file feature. The |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1720 |
"/ introduction of the Central Directory Encryption feature |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1721 |
"/ implemented in version 6.2 as part of the Strong Encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1722 |
"/ Specification defines Version 2 of this record structure. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1723 |
"/ Refer to the section describing the Strong Encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1724 |
"/ Specification for details on the version 2 format for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1725 |
"/ this record. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1726 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1727 |
"/ Special purpose data may reside in the zip64 extensible data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1728 |
"/ sector field following either a V1 or V2 version of this |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1729 |
"/ record. To ensure identification of this special purpose data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1730 |
"/ it must include an identifying header block consisting of the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1731 |
"/ following: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1732 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1733 |
"/ Header ID - 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1734 |
"/ Data Size - 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1735 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1736 |
"/ The Header ID field indicates the type of data that is in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1737 |
"/ data block that follows. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1738 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1739 |
"/ Data Size identifies the number of bytes that follow for this |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1740 |
"/ data block type. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1741 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1742 |
"/ Multiple special purpose data blocks may be present, but each |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1743 |
"/ must be preceded by a Header ID and Data Size field. Current |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1744 |
"/ mappings of Header ID values supported in this field are as |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1745 |
"/ defined in APPENDIX C. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1746 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1747 |
"/ H. Zip64 end of central directory locator |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1748 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1749 |
"/ zip64 end of central dir locator |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1750 |
"/ signature 4 bytes (0x07064b50) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1751 |
"/ number of the disk with the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1752 |
"/ start of the zip64 end of |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1753 |
"/ central directory 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1754 |
"/ relative offset of the zip64 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1755 |
"/ end of central directory record 8 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1756 |
"/ total number of disks 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1757 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1758 |
"/ I. End of central directory record: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1759 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1760 |
"/ end of central dir signature 4 bytes (0x06054b50) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1761 |
"/ number of this disk 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1762 |
"/ number of the disk with the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1763 |
"/ start of the central directory 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1764 |
"/ total number of entries in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1765 |
"/ central directory on this disk 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1766 |
"/ total number of entries in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1767 |
"/ the central directory 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1768 |
"/ size of the central directory 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1769 |
"/ offset of start of central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1770 |
"/ directory with respect to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1771 |
"/ the starting disk number 4 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1772 |
"/ .ZIP file comment length 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1773 |
"/ .ZIP file comment (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1774 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1775 |
"/ J. Explanation of fields: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1776 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1777 |
"/ version made by (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1778 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1779 |
"/ The upper byte indicates the compatibility of the file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1780 |
"/ attribute information. If the external file attributes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1781 |
"/ are compatible with MS-DOS and can be read by PKZIP for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1782 |
"/ DOS version 2.04g then this value will be zero. If these |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1783 |
"/ attributes are not compatible, then this value will |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1784 |
"/ identify the host system on which the attributes are |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1785 |
"/ compatible. Software can use this information to determine |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1786 |
"/ the line record format for text files etc. The current |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1787 |
"/ mappings are: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1788 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1789 |
"/ 0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1790 |
"/ 1 - Amiga 2 - OpenVMS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1791 |
"/ 3 - UNIX 4 - VM/CMS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1792 |
"/ 5 - Atari ST 6 - OS/2 H.P.F.S. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1793 |
"/ 7 - Macintosh 8 - Z-System |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1794 |
"/ 9 - CP/M 10 - Windows NTFS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1795 |
"/ 11 - MVS (OS/390 - Z/OS) 12 - VSE |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1796 |
"/ 13 - Acorn Risc 14 - VFAT |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1797 |
"/ 15 - alternate MVS 16 - BeOS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1798 |
"/ 17 - Tandem 18 - OS/400 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1799 |
"/ 19 - OS/X (Darwin) 20 thru 255 - unused |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1800 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1801 |
"/ The lower byte indicates the ZIP specification version |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1802 |
"/ (the version of this document) supported by the software |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1803 |
"/ used to encode the file. The value/10 indicates the major |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1804 |
"/ version number, and the value mod 10 is the minor version |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1805 |
"/ number. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1806 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1807 |
"/ version needed to extract (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1808 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1809 |
"/ The minimum supported ZIP specification version needed to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1810 |
"/ extract the file, mapped as above. This value is based on |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1811 |
"/ the specific format features a ZIP program must support to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1812 |
"/ be able to extract the file. If multiple features are |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1813 |
"/ applied to a file, the minimum version should be set to the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1814 |
"/ feature having the highest value. New features or feature |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1815 |
"/ changes affecting the published format specification will be |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1816 |
"/ implemented using higher version numbers than the last |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1817 |
"/ published value to avoid conflict. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1818 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1819 |
"/ Current minimum feature versions are as defined below: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1820 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1821 |
"/ 1.0 - Default value |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1822 |
"/ 1.1 - File is a volume label |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1823 |
"/ 2.0 - File is a folder (directory) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1824 |
"/ 2.0 - File is compressed using Deflate compression |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1825 |
"/ 2.0 - File is encrypted using traditional PKWARE encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1826 |
"/ 2.1 - File is compressed using Deflate64(tm) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1827 |
"/ 2.5 - File is compressed using PKWARE DCL Implode |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1828 |
"/ 2.7 - File is a patch data set |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1829 |
"/ 4.5 - File uses ZIP64 format extensions |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1830 |
"/ 4.6 - File is compressed using BZIP2 compression* |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1831 |
"/ 5.0 - File is encrypted using DES |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1832 |
"/ 5.0 - File is encrypted using 3DES |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1833 |
"/ 5.0 - File is encrypted using original RC2 encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1834 |
"/ 5.0 - File is encrypted using RC4 encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1835 |
"/ 5.1 - File is encrypted using AES encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1836 |
"/ 5.1 - File is encrypted using corrected RC2 encryption** |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1837 |
"/ 5.2 - File is encrypted using corrected RC2-64 encryption** |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1838 |
"/ 6.1 - File is encrypted using non-OAEP key wrapping*** |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1839 |
"/ 6.2 - Central directory encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1840 |
"/ 6.3 - File is compressed using LZMA |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1841 |
"/ 6.3 - File is compressed using PPMd+ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1842 |
"/ 6.3 - File is encrypted using Blowfish |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1843 |
"/ 6.3 - File is encrypted using Twofish |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1844 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1845 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1846 |
"/ * Early 7.x (pre-7.2) versions of PKZIP incorrectly set the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1847 |
"/ version needed to extract for BZIP2 compression to be 50 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1848 |
"/ when it should have been 46. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1849 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1850 |
"/ ** Refer to the section on Strong Encryption Specification |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1851 |
"/ for additional information regarding RC2 corrections. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1852 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1853 |
"/ *** Certificate encryption using non-OAEP key wrapping is the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1854 |
"/ intended mode of operation for all versions beginning with 6.1. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1855 |
"/ Support for OAEP key wrapping should only be used for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1856 |
"/ backward compatibility when sending ZIP files to be opened by |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1857 |
"/ versions of PKZIP older than 6.1 (5.0 or 6.0). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1858 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1859 |
"/ + Files compressed using PPMd should set the version |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1860 |
"/ needed to extract field to 6.3, however, not all ZIP |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1861 |
"/ programs enforce this and may be unable to decompress |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1862 |
"/ data files compressed using PPMd if this value is set. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1863 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1864 |
"/ When using ZIP64 extensions, the corresponding value in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1865 |
"/ zip64 end of central directory record should also be set. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1866 |
"/ This field should be set appropriately to indicate whether |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1867 |
"/ Version 1 or Version 2 format is in use. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1868 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1869 |
"/ general purpose bit flag: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1870 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1871 |
"/ Bit 0: If set, indicates that the file is encrypted. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1872 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1873 |
"/ (For Method 6 - Imploding) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1874 |
"/ Bit 1: If the compression method used was type 6, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1875 |
"/ Imploding, then this bit, if set, indicates |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1876 |
"/ an 8K sliding dictionary was used. If clear, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1877 |
"/ then a 4K sliding dictionary was used. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1878 |
"/ Bit 2: If the compression method used was type 6, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1879 |
"/ Imploding, then this bit, if set, indicates |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1880 |
"/ 3 Shannon-Fano trees were used to encode the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1881 |
"/ sliding dictionary output. If clear, then 2 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1882 |
"/ Shannon-Fano trees were used. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1883 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1884 |
"/ (For Methods 8 and 9 - Deflating) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1885 |
"/ Bit 2 Bit 1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1886 |
"/ 0 0 Normal (-en) compression option was used. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1887 |
"/ 0 1 Maximum (-exx/-ex) compression option was used. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1888 |
"/ 1 0 Fast (-ef) compression option was used. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1889 |
"/ 1 1 Super Fast (-es) compression option was used. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1890 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1891 |
"/ (For Method 14 - LZMA) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1892 |
"/ Bit 1: If the compression method used was type 14, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1893 |
"/ LZMA, then this bit, if set, indicates |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1894 |
"/ an end-of-stream (EOS) marker is used to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1895 |
"/ mark the end of the compressed data stream. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1896 |
"/ If clear, then an EOS marker is not present |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1897 |
"/ and the compressed data size must be known |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1898 |
"/ to extract. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1899 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1900 |
"/ Note: Bits 1 and 2 are undefined if the compression |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1901 |
"/ method is any other. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1902 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1903 |
"/ Bit 3: If this bit is set, the fields crc-32, compressed |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1904 |
"/ size and uncompressed size are set to zero in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1905 |
"/ local header. The correct values are put in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1906 |
"/ data descriptor immediately following the compressed |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1907 |
"/ data. (Note: PKZIP version 2.04g for DOS only |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1908 |
"/ recognizes this bit for method 8 compression, newer |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1909 |
"/ versions of PKZIP recognize this bit for any |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1910 |
"/ compression method.) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1911 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1912 |
"/ Bit 4: Reserved for use with method 8, for enhanced |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1913 |
"/ deflating. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1914 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1915 |
"/ Bit 5: If this bit is set, this indicates that the file is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1916 |
"/ compressed patched data. (Note: Requires PKZIP |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1917 |
"/ version 2.70 or greater) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1918 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1919 |
"/ Bit 6: Strong encryption. If this bit is set, you should |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1920 |
"/ set the version needed to extract value to at least |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1921 |
"/ 50 and you must also set bit 0. If AES encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1922 |
"/ is used, the version needed to extract value must |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1923 |
"/ be at least 51. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1924 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1925 |
"/ Bit 7: Currently unused. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1926 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1927 |
"/ Bit 8: Currently unused. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1928 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1929 |
"/ Bit 9: Currently unused. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1930 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1931 |
"/ Bit 10: Currently unused. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1932 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1933 |
"/ Bit 11: Language encoding flag (EFS). If this bit is set, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1934 |
"/ the filename and comment fields for this file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1935 |
"/ must be encoded using UTF-8. (see APPENDIX D) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1936 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1937 |
"/ Bit 12: Reserved by PKWARE for enhanced compression. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1938 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1939 |
"/ Bit 13: Used when encrypting the Central Directory to indicate |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1940 |
"/ selected data values in the Local Header are masked to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1941 |
"/ hide their actual values. See the section describing |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1942 |
"/ the Strong Encryption Specification for details. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1943 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1944 |
"/ Bit 14: Reserved by PKWARE. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1945 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1946 |
"/ Bit 15: Reserved by PKWARE. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1947 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1948 |
"/ compression method: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1949 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1950 |
"/ (see accompanying documentation for algorithm |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1951 |
"/ descriptions) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1952 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1953 |
"/ 0 - The file is stored (no compression) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1954 |
"/ 1 - The file is Shrunk |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1955 |
"/ 2 - The file is Reduced with compression factor 1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1956 |
"/ 3 - The file is Reduced with compression factor 2 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1957 |
"/ 4 - The file is Reduced with compression factor 3 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1958 |
"/ 5 - The file is Reduced with compression factor 4 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1959 |
"/ 6 - The file is Imploded |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1960 |
"/ 7 - Reserved for Tokenizing compression algorithm |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1961 |
"/ 8 - The file is Deflated |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1962 |
"/ 9 - Enhanced Deflating using Deflate64(tm) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1963 |
"/ 10 - PKWARE Data Compression Library Imploding (old IBM TERSE) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1964 |
"/ 11 - Reserved by PKWARE |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1965 |
"/ 12 - File is compressed using BZIP2 algorithm |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1966 |
"/ 13 - Reserved by PKWARE |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1967 |
"/ 14 - LZMA (EFS) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1968 |
"/ 15 - Reserved by PKWARE |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1969 |
"/ 16 - Reserved by PKWARE |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1970 |
"/ 17 - Reserved by PKWARE |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1971 |
"/ 18 - File is compressed using IBM TERSE (new) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1972 |
"/ 19 - IBM LZ77 z Architecture (PFS) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1973 |
"/ 97 - WavPack compressed data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1974 |
"/ 98 - PPMd version I, Rev 1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1975 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1976 |
"/ date and time fields: (2 bytes each) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1977 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1978 |
"/ The date and time are encoded in standard MS-DOS format. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1979 |
"/ If input came from standard input, the date and time are |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1980 |
"/ those at which compression was started for this data. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1981 |
"/ If encrypting the central directory and general purpose bit |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1982 |
"/ flag 13 is set indicating masking, the value stored in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1983 |
"/ Local Header will be zero. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1984 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1985 |
"/ CRC-32: (4 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1986 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1987 |
"/ The CRC-32 algorithm was generously contributed by |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1988 |
"/ David Schwaderer and can be found in his excellent |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1989 |
"/ book "C Programmers Guide to NetBIOS" published by |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1990 |
"/ Howard W. Sams & Co. Inc. The 'magic number' for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1991 |
"/ the CRC is 0xdebb20e3. The proper CRC pre and post |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1992 |
"/ conditioning is used, meaning that the CRC register |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1993 |
"/ is pre-conditioned with all ones (a starting value |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1994 |
"/ of 0xffffffff) and the value is post-conditioned by |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1995 |
"/ taking the one's complement of the CRC residual. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1996 |
"/ If bit 3 of the general purpose flag is set, this |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1997 |
"/ field is set to zero in the local header and the correct |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1998 |
"/ value is put in the data descriptor and in the central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
1999 |
"/ directory. When encrypting the central directory, if the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2000 |
"/ local header is not in ZIP64 format and general purpose |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2001 |
"/ bit flag 13 is set indicating masking, the value stored |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2002 |
"/ in the Local Header will be zero. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2003 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2004 |
"/ compressed size: (4 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2005 |
"/ uncompressed size: (4 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2006 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2007 |
"/ The size of the file compressed and uncompressed, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2008 |
"/ respectively. When a decryption header is present it will |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2009 |
"/ be placed in front of the file data and the value of the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2010 |
"/ compressed file size will include the bytes of the decryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2011 |
"/ header. If bit 3 of the general purpose bit flag is set, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2012 |
"/ these fields are set to zero in the local header and the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2013 |
"/ correct values are put in the data descriptor and |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2014 |
"/ in the central directory. If an archive is in ZIP64 format |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2015 |
"/ and the value in this field is 0xFFFFFFFF, the size will be |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2016 |
"/ in the corresponding 8 byte ZIP64 extended information |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2017 |
"/ extra field. When encrypting the central directory, if the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2018 |
"/ local header is not in ZIP64 format and general purpose bit |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2019 |
"/ flag 13 is set indicating masking, the value stored for the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2020 |
"/ uncompressed size in the Local Header will be zero. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2021 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2022 |
"/ file name length: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2023 |
"/ extra field length: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2024 |
"/ file comment length: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2025 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2026 |
"/ The length of the file name, extra field, and comment |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2027 |
"/ fields respectively. The combined length of any |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2028 |
"/ directory record and these three fields should not |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2029 |
"/ generally exceed 65,535 bytes. If input came from standard |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2030 |
"/ input, the file name length is set to zero. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2031 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2032 |
"/ disk number start: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2033 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2034 |
"/ The number of the disk on which this file begins. If an |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2035 |
"/ archive is in ZIP64 format and the value in this field is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2036 |
"/ 0xFFFF, the size will be in the corresponding 4 byte zip64 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2037 |
"/ extended information extra field. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2038 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2039 |
"/ internal file attributes: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2040 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2041 |
"/ Bits 1 and 2 are reserved for use by PKWARE. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2042 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2043 |
"/ The lowest bit of this field indicates, if set, that |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2044 |
"/ the file is apparently an ASCII or text file. If not |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2045 |
"/ set, that the file apparently contains binary data. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2046 |
"/ The remaining bits are unused in version 1.0. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2047 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2048 |
"/ The 0x0002 bit of this field indicates, if set, that a |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2049 |
"/ 4 byte variable record length control field precedes each |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2050 |
"/ logical record indicating the length of the record. The |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2051 |
"/ record length control field is stored in little-endian byte |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2052 |
"/ order. This flag is independent of text control characters, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2053 |
"/ and if used in conjunction with text data, includes any |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2054 |
"/ control characters in the total length of the record. This |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2055 |
"/ value is provided for mainframe data transfer support. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2056 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2057 |
"/ external file attributes: (4 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2058 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2059 |
"/ The mapping of the external attributes is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2060 |
"/ host-system dependent (see 'version made by'). For |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2061 |
"/ MS-DOS, the low order byte is the MS-DOS directory |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2062 |
"/ attribute byte. If input came from standard input, this |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2063 |
"/ field is set to zero. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2064 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2065 |
"/ relative offset of local header: (4 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2066 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2067 |
"/ This is the offset from the start of the first disk on |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2068 |
"/ which this file appears, to where the local header should |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2069 |
"/ be found. If an archive is in ZIP64 format and the value |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2070 |
"/ in this field is 0xFFFFFFFF, the size will be in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2071 |
"/ corresponding 8 byte zip64 extended information extra field. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2072 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2073 |
"/ file name: (Variable) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2074 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2075 |
"/ The name of the file, with optional relative path. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2076 |
"/ The path stored should not contain a drive or |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2077 |
"/ device letter, or a leading slash. All slashes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2078 |
"/ should be forward slashes '/' as opposed to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2079 |
"/ backwards slashes '\' for compatibility with Amiga |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2080 |
"/ and UNIX file systems etc. If input came from standard |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2081 |
"/ input, there is no file name field. If encrypting |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2082 |
"/ the central directory and general purpose bit flag 13 is set |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2083 |
"/ indicating masking, the file name stored in the Local Header |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2084 |
"/ will not be the actual file name. A masking value consisting |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2085 |
"/ of a unique hexadecimal value will be stored. This value will |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2086 |
"/ be sequentially incremented for each file in the archive. See |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2087 |
"/ the section on the Strong Encryption Specification for details |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2088 |
"/ on retrieving the encrypted file name. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2089 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2090 |
"/ extra field: (Variable) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2091 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2092 |
"/ This is for expansion. If additional information |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2093 |
"/ needs to be stored for special needs or for specific |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2094 |
"/ platforms, it should be stored here. Earlier versions |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2095 |
"/ of the software can then safely skip this file, and |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2096 |
"/ find the next file or header. This field will be 0 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2097 |
"/ length in version 1.0. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2098 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2099 |
"/ In order to allow different programs and different types |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2100 |
"/ of information to be stored in the 'extra' field in .ZIP |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2101 |
"/ files, the following structure should be used for all |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2102 |
"/ programs storing data in this field: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2103 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2104 |
"/ header1+data1 + header2+data2 . . . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2105 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2106 |
"/ Each header should consist of: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2107 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2108 |
"/ Header ID - 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2109 |
"/ Data Size - 2 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2110 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2111 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2112 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2113 |
"/ The Header ID field indicates the type of data that is in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2114 |
"/ the following data block. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2115 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2116 |
"/ Header ID's of 0 thru 31 are reserved for use by PKWARE. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2117 |
"/ The remaining ID's can be used by third party vendors for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2118 |
"/ proprietary usage. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2119 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2120 |
"/ The current Header ID mappings defined by PKWARE are: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2121 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2122 |
"/ 0x0001 Zip64 extended information extra field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2123 |
"/ 0x0007 AV Info |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2124 |
"/ 0x0008 Reserved for extended language encoding data (PFS) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2125 |
"/ (see APPENDIX D) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2126 |
"/ 0x0009 OS/2 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2127 |
"/ 0x000a NTFS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2128 |
"/ 0x000c OpenVMS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2129 |
"/ 0x000d UNIX |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2130 |
"/ 0x000e Reserved for file stream and fork descriptors |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2131 |
"/ 0x000f Patch Descriptor |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2132 |
"/ 0x0014 PKCS#7 Store for X.509 Certificates |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2133 |
"/ 0x0015 X.509 Certificate ID and Signature for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2134 |
"/ individual file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2135 |
"/ 0x0016 X.509 Certificate ID for Central Directory |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2136 |
"/ 0x0017 Strong Encryption Header |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2137 |
"/ 0x0018 Record Management Controls |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2138 |
"/ 0x0019 PKCS#7 Encryption Recipient Certificate List |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2139 |
"/ 0x0065 IBM S/390 (Z390), AS/400 (I400) attributes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2140 |
"/ - uncompressed |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2141 |
"/ 0x0066 Reserved for IBM S/390 (Z390), AS/400 (I400) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2142 |
"/ attributes - compressed |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2143 |
"/ 0x4690 POSZIP 4690 (reserved) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2144 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2145 |
"/ Third party mappings commonly used are: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2146 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2147 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2148 |
"/ 0x07c8 Macintosh |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2149 |
"/ 0x2605 ZipIt Macintosh |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2150 |
"/ 0x2705 ZipIt Macintosh 1.3.5+ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2151 |
"/ 0x2805 ZipIt Macintosh 1.3.5+ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2152 |
"/ 0x334d Info-ZIP Macintosh |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2153 |
"/ 0x4341 Acorn/SparkFS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2154 |
"/ 0x4453 Windows NT security descriptor (binary ACL) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2155 |
"/ 0x4704 VM/CMS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2156 |
"/ 0x470f MVS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2157 |
"/ 0x4b46 FWKCS MD5 (see below) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2158 |
"/ 0x4c41 OS/2 access control list (text ACL) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2159 |
"/ 0x4d49 Info-ZIP OpenVMS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2160 |
"/ 0x4f4c Xceed original location extra field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2161 |
"/ 0x5356 AOS/VS (ACL) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2162 |
"/ 0x5455 extended timestamp |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2163 |
"/ 0x554e Xceed unicode extra field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2164 |
"/ 0x5855 Info-ZIP UNIX (original, also OS/2, NT, etc) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2165 |
"/ 0x6375 Info-ZIP Unicode Comment Extra Field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2166 |
"/ 0x6542 BeOS/BeBox |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2167 |
"/ 0x7075 Info-ZIP Unicode Path Extra Field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2168 |
"/ 0x756e ASi UNIX |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2169 |
"/ 0x7855 Info-ZIP UNIX (new) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2170 |
"/ 0xa220 Microsoft Open Packaging Growth Hint |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2171 |
"/ 0xfd4a SMS/QDOS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2172 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2173 |
"/ Detailed descriptions of Extra Fields defined by third |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2174 |
"/ party mappings will be documented as information on |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2175 |
"/ these data structures is made available to PKWARE. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2176 |
"/ PKWARE does not guarantee the accuracy of any published |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2177 |
"/ third party data. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2178 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2179 |
"/ The Data Size field indicates the size of the following |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2180 |
"/ data block. Programs can use this value to skip to the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2181 |
"/ next header block, passing over any data blocks that are |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2182 |
"/ not of interest. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2183 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2184 |
"/ Note: As stated above, the size of the entire .ZIP file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2185 |
"/ header, including the file name, comment, and extra |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2186 |
"/ field should not exceed 64K in size. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2187 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2188 |
"/ In case two different programs should appropriate the same |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2189 |
"/ Header ID value, it is strongly recommended that each |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2190 |
"/ program place a unique signature of at least two bytes in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2191 |
"/ size (and preferably 4 bytes or bigger) at the start of |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2192 |
"/ each data area. Every program should verify that its |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2193 |
"/ unique signature is present, in addition to the Header ID |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2194 |
"/ value being correct, before assuming that it is a block of |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2195 |
"/ known type. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2196 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2197 |
"/ -Zip64 Extended Information Extra Field (0x0001): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2198 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2199 |
"/ The following is the layout of the zip64 extended |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2200 |
"/ information "extra" block. If one of the size or |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2201 |
"/ offset fields in the Local or Central directory |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2202 |
"/ record is too small to hold the required data, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2203 |
"/ a Zip64 extended information record is created. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2204 |
"/ The order of the fields in the zip64 extended |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2205 |
"/ information record is fixed, but the fields will |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2206 |
"/ only appear if the corresponding Local or Central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2207 |
"/ directory record field is set to 0xFFFF or 0xFFFFFFFF. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2208 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2209 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2210 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2211 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2212 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2213 |
"/ (ZIP64) 0x0001 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2214 |
"/ Size 2 bytes Size of this "extra" block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2215 |
"/ Original |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2216 |
"/ Size 8 bytes Original uncompressed file size |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2217 |
"/ Compressed |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2218 |
"/ Size 8 bytes Size of compressed data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2219 |
"/ Relative Header |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2220 |
"/ Offset 8 bytes Offset of local header record |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2221 |
"/ Disk Start |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2222 |
"/ Number 4 bytes Number of the disk on which |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2223 |
"/ this file starts |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2224 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2225 |
"/ This entry in the Local header must include BOTH original |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2226 |
"/ and compressed file size fields. If encrypting the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2227 |
"/ central directory and bit 13 of the general purpose bit |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2228 |
"/ flag is set indicating masking, the value stored in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2229 |
"/ Local Header for the original file size will be zero. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2230 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2231 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2232 |
"/ -OS/2 Extra Field (0x0009): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2233 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2234 |
"/ The following is the layout of the OS/2 attributes "extra" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2235 |
"/ block. (Last Revision 09/05/95) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2236 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2237 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2238 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2239 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2240 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2241 |
"/ (OS/2) 0x0009 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2242 |
"/ TSize 2 bytes Size for the following data block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2243 |
"/ BSize 4 bytes Uncompressed Block Size |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2244 |
"/ CType 2 bytes Compression type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2245 |
"/ EACRC 4 bytes CRC value for uncompress block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2246 |
"/ (var) variable Compressed block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2247 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2248 |
"/ The OS/2 extended attribute structure (FEA2LIST) is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2249 |
"/ compressed and then stored in it's entirety within this |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2250 |
"/ structure. There will only ever be one "block" of data in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2251 |
"/ VarFields[]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2252 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2253 |
"/ -NTFS Extra Field (0x000a): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2254 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2255 |
"/ The following is the layout of the NTFS attributes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2256 |
"/ "extra" block. (Note: At this time the Mtime, Atime |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2257 |
"/ and Ctime values may be used on any WIN32 system.) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2258 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2259 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2260 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2261 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2262 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2263 |
"/ (NTFS) 0x000a 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2264 |
"/ TSize 2 bytes Size of the total "extra" block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2265 |
"/ Reserved 4 bytes Reserved for future use |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2266 |
"/ Tag1 2 bytes NTFS attribute tag value #1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2267 |
"/ Size1 2 bytes Size of attribute #1, in bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2268 |
"/ (var.) Size1 Attribute #1 data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2269 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2270 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2271 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2272 |
"/ TagN 2 bytes NTFS attribute tag value #N |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2273 |
"/ SizeN 2 bytes Size of attribute #N, in bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2274 |
"/ (var.) SizeN Attribute #N data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2275 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2276 |
"/ For NTFS, values for Tag1 through TagN are as follows: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2277 |
"/ (currently only one set of attributes is defined for NTFS) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2278 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2279 |
"/ Tag Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2280 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2281 |
"/ 0x0001 2 bytes Tag for attribute #1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2282 |
"/ Size1 2 bytes Size of attribute #1, in bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2283 |
"/ Mtime 8 bytes File last modification time |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2284 |
"/ Atime 8 bytes File last access time |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2285 |
"/ Ctime 8 bytes File creation time |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2286 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2287 |
"/ -OpenVMS Extra Field (0x000c): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2288 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2289 |
"/ The following is the layout of the OpenVMS attributes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2290 |
"/ "extra" block. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2291 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2292 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2293 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2294 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2295 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2296 |
"/ (VMS) 0x000c 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2297 |
"/ TSize 2 bytes Size of the total "extra" block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2298 |
"/ CRC 4 bytes 32-bit CRC for remainder of the block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2299 |
"/ Tag1 2 bytes OpenVMS attribute tag value #1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2300 |
"/ Size1 2 bytes Size of attribute #1, in bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2301 |
"/ (var.) Size1 Attribute #1 data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2302 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2303 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2304 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2305 |
"/ TagN 2 bytes OpenVMS attribute tag value #N |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2306 |
"/ SizeN 2 bytes Size of attribute #N, in bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2307 |
"/ (var.) SizeN Attribute #N data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2308 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2309 |
"/ Rules: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2310 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2311 |
"/ 1. There will be one or more of attributes present, which |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2312 |
"/ will each be preceded by the above TagX & SizeX values. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2313 |
"/ These values are identical to the ATR$C_XXXX and |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2314 |
"/ ATR$S_XXXX constants which are defined in ATR.H under |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2315 |
"/ OpenVMS C. Neither of these values will ever be zero. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2316 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2317 |
"/ 2. No word alignment or padding is performed. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2318 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2319 |
"/ 3. A well-behaved PKZIP/OpenVMS program should never produce |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2320 |
"/ more than one sub-block with the same TagX value. Also, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2321 |
"/ there will never be more than one "extra" block of type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2322 |
"/ 0x000c in a particular directory record. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2323 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2324 |
"/ -UNIX Extra Field (0x000d): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2325 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2326 |
"/ The following is the layout of the UNIX "extra" block. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2327 |
"/ Note: all fields are stored in Intel low-byte/high-byte |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2328 |
"/ order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2329 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2330 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2331 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2332 |
"/ (UNIX) 0x000d 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2333 |
"/ TSize 2 bytes Size for the following data block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2334 |
"/ Atime 4 bytes File last access time |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2335 |
"/ Mtime 4 bytes File last modification time |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2336 |
"/ Uid 2 bytes File user ID |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2337 |
"/ Gid 2 bytes File group ID |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2338 |
"/ (var) variable Variable length data field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2339 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2340 |
"/ The variable length data field will contain file type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2341 |
"/ specific data. Currently the only values allowed are |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2342 |
"/ the original "linked to" file names for hard or symbolic |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2343 |
"/ links, and the major and minor device node numbers for |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2344 |
"/ character and block device nodes. Since device nodes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2345 |
"/ cannot be either symbolic or hard links, only one set of |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2346 |
"/ variable length data is stored. Link files will have the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2347 |
"/ name of the original file stored. This name is NOT NULL |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2348 |
"/ terminated. Its size can be determined by checking TSize - |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2349 |
"/ 12. Device entries will have eight bytes stored as two 4 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2350 |
"/ byte entries (in little endian format). The first entry |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2351 |
"/ will be the major device number, and the second the minor |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2352 |
"/ device number. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2353 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2354 |
"/ -PATCH Descriptor Extra Field (0x000f): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2355 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2356 |
"/ The following is the layout of the Patch Descriptor "extra" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2357 |
"/ block. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2358 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2359 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2360 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2361 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2362 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2363 |
"/ (Patch) 0x000f 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2364 |
"/ TSize 2 bytes Size of the total "extra" block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2365 |
"/ Version 2 bytes Version of the descriptor |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2366 |
"/ Flags 4 bytes Actions and reactions (see below) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2367 |
"/ OldSize 4 bytes Size of the file about to be patched |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2368 |
"/ OldCRC 4 bytes 32-bit CRC of the file to be patched |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2369 |
"/ NewSize 4 bytes Size of the resulting file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2370 |
"/ NewCRC 4 bytes 32-bit CRC of the resulting file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2371 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2372 |
"/ Actions and reactions |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2373 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2374 |
"/ Bits Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2375 |
"/ ---- ---------------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2376 |
"/ 0 Use for auto detection |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2377 |
"/ 1 Treat as a self-patch |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2378 |
"/ 2-3 RESERVED |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2379 |
"/ 4-5 Action (see below) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2380 |
"/ 6-7 RESERVED |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2381 |
"/ 8-9 Reaction (see below) to absent file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2382 |
"/ 10-11 Reaction (see below) to newer file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2383 |
"/ 12-13 Reaction (see below) to unknown file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2384 |
"/ 14-15 RESERVED |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2385 |
"/ 16-31 RESERVED |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2386 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2387 |
"/ Actions |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2388 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2389 |
"/ Action Value |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2390 |
"/ ------ ----- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2391 |
"/ none 0 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2392 |
"/ add 1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2393 |
"/ delete 2 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2394 |
"/ patch 3 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2395 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2396 |
"/ Reactions |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2397 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2398 |
"/ Reaction Value |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2399 |
"/ -------- ----- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2400 |
"/ ask 0 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2401 |
"/ skip 1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2402 |
"/ ignore 2 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2403 |
"/ fail 3 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2404 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2405 |
"/ Patch support is provided by PKPatchMaker(tm) technology and is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2406 |
"/ covered under U.S. Patents and Patents Pending. The use or |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2407 |
"/ implementation in a product of certain technological aspects set |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2408 |
"/ forth in the current APPNOTE, including those with regard to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2409 |
"/ strong encryption, patching, or extended tape operations requires |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2410 |
"/ a license from PKWARE. Please contact PKWARE with regard to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2411 |
"/ acquiring a license. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2412 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2413 |
"/ -PKCS#7 Store for X.509 Certificates (0x0014): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2414 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2415 |
"/ This field contains information about each of the certificates |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2416 |
"/ files may be signed with. When the Central Directory Encryption |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2417 |
"/ feature is enabled for a ZIP file, this record will appear in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2418 |
"/ the Archive Extra Data Record, otherwise it will appear in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2419 |
"/ first central directory record and will be ignored in any |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2420 |
"/ other record. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2421 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2422 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2423 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2424 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2425 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2426 |
"/ (Store) 0x0014 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2427 |
"/ TSize 2 bytes Size of the store data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2428 |
"/ TData TSize Data about the store |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2429 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2430 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2431 |
"/ -X.509 Certificate ID and Signature for individual file (0x0015): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2432 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2433 |
"/ This field contains the information about which certificate in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2434 |
"/ the PKCS#7 store was used to sign a particular file. It also |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2435 |
"/ contains the signature data. This field can appear multiple |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2436 |
"/ times, but can only appear once per certificate. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2437 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2438 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2439 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2440 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2441 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2442 |
"/ (CID) 0x0015 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2443 |
"/ TSize 2 bytes Size of data that follows |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2444 |
"/ TData TSize Signature Data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2445 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2446 |
"/ -X.509 Certificate ID and Signature for central directory (0x0016): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2447 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2448 |
"/ This field contains the information about which certificate in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2449 |
"/ the PKCS#7 store was used to sign the central directory structure. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2450 |
"/ When the Central Directory Encryption feature is enabled for a |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2451 |
"/ ZIP file, this record will appear in the Archive Extra Data Record, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2452 |
"/ otherwise it will appear in the first central directory record. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2453 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2454 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2455 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2456 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2457 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2458 |
"/ (CDID) 0x0016 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2459 |
"/ TSize 2 bytes Size of data that follows |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2460 |
"/ TData TSize Data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2461 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2462 |
"/ -Strong Encryption Header (0x0017): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2463 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2464 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2465 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2466 |
"/ 0x0017 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2467 |
"/ TSize 2 bytes Size of data that follows |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2468 |
"/ Format 2 bytes Format definition for this record |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2469 |
"/ AlgID 2 bytes Encryption algorithm identifier |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2470 |
"/ Bitlen 2 bytes Bit length of encryption key |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2471 |
"/ Flags 2 bytes Processing flags |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2472 |
"/ CertData TSize-8 Certificate decryption extra field data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2473 |
"/ (refer to the explanation for CertData |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2474 |
"/ in the section describing the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2475 |
"/ Certificate Processing Method under |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2476 |
"/ the Strong Encryption Specification) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2477 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2478 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2479 |
"/ -Record Management Controls (0x0018): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2480 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2481 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2482 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2483 |
"/(Rec-CTL) 0x0018 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2484 |
"/ CSize 2 bytes Size of total extra block data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2485 |
"/ Tag1 2 bytes Record control attribute 1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2486 |
"/ Size1 2 bytes Size of attribute 1, in bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2487 |
"/ Data1 Size1 Attribute 1 data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2488 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2489 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2490 |
"/ . |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2491 |
"/ TagN 2 bytes Record control attribute N |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2492 |
"/ SizeN 2 bytes Size of attribute N, in bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2493 |
"/ DataN SizeN Attribute N data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2494 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2495 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2496 |
"/ -PKCS#7 Encryption Recipient Certificate List (0x0019): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2497 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2498 |
"/ This field contains information about each of the certificates |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2499 |
"/ used in encryption processing and it can be used to identify who is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2500 |
"/ allowed to decrypt encrypted files. This field should only appear |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2501 |
"/ in the archive extra data record. This field is not required and |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2502 |
"/ serves only to aide archive modifications by preserving public |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2503 |
"/ encryption key data. Individual security requirements may dictate |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2504 |
"/ that this data be omitted to deter information exposure. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2505 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2506 |
"/ Note: all fields stored in Intel low-byte/high-byte order. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2507 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2508 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2509 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2510 |
"/ (CStore) 0x0019 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2511 |
"/ TSize 2 bytes Size of the store data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2512 |
"/ TData TSize Data about the store |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2513 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2514 |
"/ TData: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2515 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2516 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2517 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2518 |
"/ Version 2 bytes Format version number - must 0x0001 at this time |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2519 |
"/ CStore (var) PKCS#7 data blob |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2520 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2521 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2522 |
"/ -MVS Extra Field (0x0065): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2523 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2524 |
"/ The following is the layout of the MVS "extra" block. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2525 |
"/ Note: Some fields are stored in Big Endian format. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2526 |
"/ All text is in EBCDIC format unless otherwise specified. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2527 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2528 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2529 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2530 |
"/ (MVS) 0x0065 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2531 |
"/ TSize 2 bytes Size for the following data block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2532 |
"/ ID 4 bytes EBCDIC "Z390" 0xE9F3F9F0 or |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2533 |
"/ "T4MV" for TargetFour |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2534 |
"/ (var) TSize-4 Attribute data (see APPENDIX B) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2535 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2536 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2537 |
"/ -OS/400 Extra Field (0x0065): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2538 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2539 |
"/ The following is the layout of the OS/400 "extra" block. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2540 |
"/ Note: Some fields are stored in Big Endian format. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2541 |
"/ All text is in EBCDIC format unless otherwise specified. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2542 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2543 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2544 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2545 |
"/ (OS400) 0x0065 2 bytes Tag for this "extra" block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2546 |
"/ TSize 2 bytes Size for the following data block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2547 |
"/ ID 4 bytes EBCDIC "I400" 0xC9F4F0F0 or |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2548 |
"/ "T4MV" for TargetFour |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2549 |
"/ (var) TSize-4 Attribute data (see APPENDIX A) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2550 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2551 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2552 |
"/ Third-party Mappings: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2553 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2554 |
"/ -ZipIt Macintosh Extra Field (long) (0x2605): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2555 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2556 |
"/ The following is the layout of the ZipIt extra block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2557 |
"/ for Macintosh. The local-header and central-header versions |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2558 |
"/ are identical. This block must be present if the file is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2559 |
"/ stored MacBinary-encoded and it should not be used if the file |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2560 |
"/ is not stored MacBinary-encoded. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2561 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2562 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2563 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2564 |
"/ (Mac2) 0x2605 Short tag for this extra block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2565 |
"/ TSize Short total data size for this block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2566 |
"/ "ZPIT" beLong extra-field signature |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2567 |
"/ FnLen Byte length of FileName |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2568 |
"/ FileName variable full Macintosh filename |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2569 |
"/ FileType Byte[4] four-byte Mac file type string |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2570 |
"/ Creator Byte[4] four-byte Mac creator string |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2571 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2572 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2573 |
"/ -ZipIt Macintosh Extra Field (short, for files) (0x2705): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2574 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2575 |
"/ The following is the layout of a shortened variant of the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2576 |
"/ ZipIt extra block for Macintosh (without "full name" entry). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2577 |
"/ This variant is used by ZipIt 1.3.5 and newer for entries of |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2578 |
"/ files (not directories) that do not have a MacBinary encoded |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2579 |
"/ file. The local-header and central-header versions are identical. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2580 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2581 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2582 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2583 |
"/ (Mac2b) 0x2705 Short tag for this extra block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2584 |
"/ TSize Short total data size for this block (12) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2585 |
"/ "ZPIT" beLong extra-field signature |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2586 |
"/ FileType Byte[4] four-byte Mac file type string |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2587 |
"/ Creator Byte[4] four-byte Mac creator string |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2588 |
"/ fdFlags beShort attributes from FInfo.frFlags, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2589 |
"/ may be omitted |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2590 |
"/ 0x0000 beShort reserved, may be omitted |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2591 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2592 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2593 |
"/ -ZipIt Macintosh Extra Field (short, for directories) (0x2805): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2594 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2595 |
"/ The following is the layout of a shortened variant of the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2596 |
"/ ZipIt extra block for Macintosh used only for directory |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2597 |
"/ entries. This variant is used by ZipIt 1.3.5 and newer to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2598 |
"/ save some optional Mac-specific information about directories. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2599 |
"/ The local-header and central-header versions are identical. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2600 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2601 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2602 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2603 |
"/ (Mac2c) 0x2805 Short tag for this extra block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2604 |
"/ TSize Short total data size for this block (12) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2605 |
"/ "ZPIT" beLong extra-field signature |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2606 |
"/ frFlags beShort attributes from DInfo.frFlags, may |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2607 |
"/ be omitted |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2608 |
"/ View beShort ZipIt view flag, may be omitted |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2609 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2610 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2611 |
"/ The View field specifies ZipIt-internal settings as follows: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2612 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2613 |
"/ Bits of the Flags: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2614 |
"/ bit 0 if set, the folder is shown expanded (open) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2615 |
"/ when the archive contents are viewed in ZipIt. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2616 |
"/ bits 1-15 reserved, zero; |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2617 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2618 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2619 |
"/ -FWKCS MD5 Extra Field (0x4b46): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2620 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2621 |
"/ The FWKCS Contents_Signature System, used in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2622 |
"/ automatically identifying files independent of file name, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2623 |
"/ optionally adds and uses an extra field to support the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2624 |
"/ rapid creation of an enhanced contents_signature: |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2625 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2626 |
"/ Header ID = 0x4b46 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2627 |
"/ Data Size = 0x0013 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2628 |
"/ Preface = 'M','D','5' |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2629 |
"/ followed by 16 bytes containing the uncompressed file's |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2630 |
"/ 128_bit MD5 hash(1), low byte first. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2631 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2632 |
"/ When FWKCS revises a .ZIP file central directory to add |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2633 |
"/ this extra field for a file, it also replaces the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2634 |
"/ central directory entry for that file's uncompressed |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2635 |
"/ file length with a measured value. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2636 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2637 |
"/ FWKCS provides an option to strip this extra field, if |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2638 |
"/ present, from a .ZIP file central directory. In adding |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2639 |
"/ this extra field, FWKCS preserves .ZIP file Authenticity |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2640 |
"/ Verification; if stripping this extra field, FWKCS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2641 |
"/ preserves all versions of AV through PKZIP version 2.04g. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2642 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2643 |
"/ FWKCS, and FWKCS Contents_Signature System, are |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2644 |
"/ trademarks of Frederick W. Kantor. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2645 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2646 |
"/ (1) R. Rivest, RFC1321.TXT, MIT Laboratory for Computer |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2647 |
"/ Science and RSA Data Security, Inc., April 1992. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2648 |
"/ ll.76-77: "The MD5 algorithm is being placed in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2649 |
"/ public domain for review and possible adoption as a |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2650 |
"/ standard." |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2651 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2652 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2653 |
"/ -Info-ZIP Unicode Comment Extra Field (0x6375): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2654 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2655 |
"/ Stores the UTF-8 version of the file comment as stored in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2656 |
"/ central directory header. (Last Revision 20070912) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2657 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2658 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2659 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2660 |
"/ (UCom) 0x6375 Short tag for this extra block type ("uc") |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2661 |
"/ TSize Short total data size for this block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2662 |
"/ Version 1 byte version of this extra field, currently 1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2663 |
"/ ComCRC32 4 bytes Comment Field CRC32 Checksum |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2664 |
"/ UnicodeCom Variable UTF-8 version of the entry comment |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2665 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2666 |
"/ Currently Version is set to the number 1. If there is a need |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2667 |
"/ to change this field, the version will be incremented. Changes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2668 |
"/ may not be backward compatible so this extra field should not be |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2669 |
"/ used if the version is not recognized. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2670 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2671 |
"/ The ComCRC32 is the standard zip CRC32 checksum of the File Comment |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2672 |
"/ field in the central directory header. This is used to verify that |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2673 |
"/ the comment field has not changed since the Unicode Comment extra field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2674 |
"/ was created. This can happen if a utility changes the File Comment |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2675 |
"/ field but does not update the UTF-8 Comment extra field. If the CRC |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2676 |
"/ check fails, this Unicode Comment extra field should be ignored and |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2677 |
"/ the File Comment field in the header should be used instead. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2678 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2679 |
"/ The UnicodeCom field is the UTF-8 version of the File Comment field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2680 |
"/ in the header. As UnicodeCom is defined to be UTF-8, no UTF-8 byte |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2681 |
"/ order mark (BOM) is used. The length of this field is determined by |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2682 |
"/ subtracting the size of the previous fields from TSize. If both the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2683 |
"/ File Name and Comment fields are UTF-8, the new General Purpose Bit |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2684 |
"/ Flag, bit 11 (Language encoding flag (EFS)), can be used to indicate |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2685 |
"/ both the header File Name and Comment fields are UTF-8 and, in this |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2686 |
"/ case, the Unicode Path and Unicode Comment extra fields are not |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2687 |
"/ needed and should not be created. Note that, for backward |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2688 |
"/ compatibility, bit 11 should only be used if the native character set |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2689 |
"/ of the paths and comments being zipped up are already in UTF-8. It is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2690 |
"/ expected that the same file comment storage method, either general |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2691 |
"/ purpose bit 11 or extra fields, be used in both the Local and Central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2692 |
"/ Directory Header for a file. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2693 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2694 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2695 |
"/ -Info-ZIP Unicode Path Extra Field (0x7075): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2696 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2697 |
"/ Stores the UTF-8 version of the file name field as stored in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2698 |
"/ local header and central directory header. (Last Revision 20070912) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2699 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2700 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2701 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2702 |
"/ (UPath) 0x7075 Short tag for this extra block type ("up") |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2703 |
"/ TSize Short total data size for this block |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2704 |
"/ Version 1 byte version of this extra field, currently 1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2705 |
"/ NameCRC32 4 bytes File Name Field CRC32 Checksum |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2706 |
"/ UnicodeName Variable UTF-8 version of the entry File Name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2707 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2708 |
"/ Currently Version is set to the number 1. If there is a need |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2709 |
"/ to change this field, the version will be incremented. Changes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2710 |
"/ may not be backward compatible so this extra field should not be |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2711 |
"/ used if the version is not recognized. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2712 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2713 |
"/ The NameCRC32 is the standard zip CRC32 checksum of the File Name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2714 |
"/ field in the header. This is used to verify that the header |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2715 |
"/ File Name field has not changed since the Unicode Path extra field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2716 |
"/ was created. This can happen if a utility renames the File Name but |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2717 |
"/ does not update the UTF-8 path extra field. If the CRC check fails, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2718 |
"/ this UTF-8 Path Extra Field should be ignored and the File Name field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2719 |
"/ in the header should be used instead. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2720 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2721 |
"/ The UnicodeName is the UTF-8 version of the contents of the File Name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2722 |
"/ field in the header. As UnicodeName is defined to be UTF-8, no UTF-8 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2723 |
"/ byte order mark (BOM) is used. The length of this field is determined |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2724 |
"/ by subtracting the size of the previous fields from TSize. If both |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2725 |
"/ the File Name and Comment fields are UTF-8, the new General Purpose |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2726 |
"/ Bit Flag, bit 11 (Language encoding flag (EFS)), can be used to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2727 |
"/ indicate that both the header File Name and Comment fields are UTF-8 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2728 |
"/ and, in this case, the Unicode Path and Unicode Comment extra fields |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2729 |
"/ are not needed and should not be created. Note that, for backward |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2730 |
"/ compatibility, bit 11 should only be used if the native character set |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2731 |
"/ of the paths and comments being zipped up are already in UTF-8. It is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2732 |
"/ expected that the same file name storage method, either general |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2733 |
"/ purpose bit 11 or extra fields, be used in both the Local and Central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2734 |
"/ Directory Header for a file. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2735 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2736 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2737 |
"/ -Microsoft Open Packaging Growth Hint (0xa220): |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2738 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2739 |
"/ Value Size Description |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2740 |
"/ ----- ---- ----------- |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2741 |
"/ 0xa220 Short tag for this extra block type |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2742 |
"/ TSize Short size of Sig + PadVal + Padding |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2743 |
"/ Sig Short verification signature (A028) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2744 |
"/ PadVal Short Initial padding value |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2745 |
"/ Padding variable filled with NULL characters |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2746 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2747 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2748 |
"/ file comment: (Variable) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2749 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2750 |
"/ The comment for this file. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2751 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2752 |
"/ number of this disk: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2753 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2754 |
"/ The number of this disk, which contains central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2755 |
"/ directory end record. If an archive is in ZIP64 format |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2756 |
"/ and the value in this field is 0xFFFF, the size will |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2757 |
"/ be in the corresponding 4 byte zip64 end of central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2758 |
"/ directory field. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2759 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2760 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2761 |
"/ number of the disk with the start of the central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2762 |
"/ directory: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2763 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2764 |
"/ The number of the disk on which the central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2765 |
"/ directory starts. If an archive is in ZIP64 format |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2766 |
"/ and the value in this field is 0xFFFF, the size will |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2767 |
"/ be in the corresponding 4 byte zip64 end of central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2768 |
"/ directory field. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2769 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2770 |
"/ total number of entries in the central dir on |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2771 |
"/ this disk: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2772 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2773 |
"/ The number of central directory entries on this disk. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2774 |
"/ If an archive is in ZIP64 format and the value in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2775 |
"/ this field is 0xFFFF, the size will be in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2776 |
"/ corresponding 8 byte zip64 end of central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2777 |
"/ directory field. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2778 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2779 |
"/ total number of entries in the central dir: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2780 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2781 |
"/ The total number of files in the .ZIP file. If an |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2782 |
"/ archive is in ZIP64 format and the value in this field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2783 |
"/ is 0xFFFF, the size will be in the corresponding 8 byte |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2784 |
"/ zip64 end of central directory field. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2785 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2786 |
"/ size of the central directory: (4 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2787 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2788 |
"/ The size (in bytes) of the entire central directory. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2789 |
"/ If an archive is in ZIP64 format and the value in |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2790 |
"/ this field is 0xFFFFFFFF, the size will be in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2791 |
"/ corresponding 8 byte zip64 end of central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2792 |
"/ directory field. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2793 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2794 |
"/ offset of start of central directory with respect to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2795 |
"/ the starting disk number: (4 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2796 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2797 |
"/ Offset of the start of the central directory on the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2798 |
"/ disk on which the central directory starts. If an |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2799 |
"/ archive is in ZIP64 format and the value in this |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2800 |
"/ field is 0xFFFFFFFF, the size will be in the |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2801 |
"/ corresponding 8 byte zip64 end of central |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2802 |
"/ directory field. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2803 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2804 |
"/ .ZIP file comment length: (2 bytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2805 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2806 |
"/ The length of the comment for this .ZIP file. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2807 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2808 |
"/ .ZIP file comment: (Variable) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2809 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2810 |
"/ The comment for this .ZIP file. ZIP file comment data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2811 |
"/ is stored unsecured. No encryption or data authentication |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2812 |
"/ is applied to this area at this time. Confidential information |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2813 |
"/ should not be stored in this section. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2814 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2815 |
"/ zip64 extensible data sector (variable size) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2816 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2817 |
"/ (currently reserved for use by PKWARE) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2818 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2819 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2820 |
"/ K. Splitting and Spanning ZIP files |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2821 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2822 |
"/ Spanning is the process of segmenting a ZIP file across |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2823 |
"/ multiple removable media. This support has typically only |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2824 |
"/ been provided for DOS formatted floppy diskettes. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2825 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2826 |
"/ File splitting is a newer derivative of spanning. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2827 |
"/ Splitting follows the same segmentation process as |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2828 |
"/ spanning, however, it does not require writing each |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2829 |
"/ segment to a unique removable medium and instead supports |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2830 |
"/ placing all pieces onto local or non-removable locations |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2831 |
"/ such as file systems, local drives, folders, etc... |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2832 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2833 |
"/ A key difference between spanned and split ZIP files is |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2834 |
"/ that all pieces of a spanned ZIP file have the same name. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2835 |
"/ Since each piece is written to a separate volume, no name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2836 |
"/ collisions occur and each segment can reuse the original |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2837 |
"/ .ZIP file name given to the archive. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2838 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2839 |
"/ Sequence ordering for DOS spanned archives uses the DOS |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2840 |
"/ volume label to determine segment numbers. Volume labels |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2841 |
"/ for each segment are written using the form PKBACK#xxx, |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2842 |
"/ where xxx is the segment number written as a decimal |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2843 |
"/ value from 001 - nnn. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2844 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2845 |
"/ Split ZIP files are typically written to the same location |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2846 |
"/ and are subject to name collisions if the spanned name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2847 |
"/ format is used since each segment will reside on the same |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2848 |
"/ drive. To avoid name collisions, split archives are named |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2849 |
"/ as follows. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2850 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2851 |
"/ Segment 1 = filename.z01 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2852 |
"/ Segment n-1 = filename.z(n-1) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2853 |
"/ Segment n = filename.zip |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2854 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2855 |
"/ The .ZIP extension is used on the last segment to support |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2856 |
"/ quickly reading the central directory. The segment number |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2857 |
"/ n should be a decimal value. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2858 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2859 |
"/ Spanned ZIP files may be PKSFX Self-extracting ZIP files. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2860 |
"/ PKSFX files may also be split, however, in this case |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2861 |
"/ the first segment must be named filename.exe. The first |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2862 |
"/ segment of a split PKSFX archive must be large enough to |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2863 |
"/ include the entire executable program. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2864 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2865 |
"/ Capacities for split archives are as follows. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2866 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2867 |
"/ Maximum number of segments = 4,294,967,295 - 1 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2868 |
"/ Maximum .ZIP segment size = 4,294,967,295 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2869 |
"/ Minimum segment size = 64K |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2870 |
"/ Maximum PKSFX segment size = 2,147,483,647 bytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2871 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2872 |
"/ Segment sizes may be |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2873 |
! ! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2874 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2875 |
!ZipArchive class methodsFor:'instance creation'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2876 |
|
1986 | 2877 |
isZipArchive:aFileName |
2878 |
|f fn| |
|
2879 |
||
2880 |
f := aFileName asFilename. |
|
2881 |
f exists ifFalse:[^ false]. |
|
1987 | 2882 |
f isDirectory ifTrue:[^ false]. |
1986 | 2883 |
|
2884 |
fn := f pathName. |
|
2885 |
||
2886 |
^ self new checkZipArchive: fn. |
|
2887 |
||
2888 |
||
2889 |
"Created: / 29.3.1998 / 17:46:09 / cg" |
|
2890 |
"Modified: / 20.10.1998 / 00:30:02 / cg" |
|
2891 |
! |
|
2892 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2893 |
newFileNamed:name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2894 |
^ self new name:name mode:#write |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2895 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2896 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2897 |
oldFileNamed:name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2898 |
|zar f fn| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2899 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2900 |
f := name asFilename. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2901 |
f exists ifFalse:[^ nil]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2902 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2903 |
fn := f pathName. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2904 |
zar := self new name:fn mode:#read. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2905 |
^ zar |
1994 | 2906 |
! |
2907 |
||
2908 |
oldFileNamed:name startOfArchive: startOfArchive endOfArchive: endOfArchive |
|
2909 |
|zar f fn| |
|
2910 |
||
2911 |
f := name asFilename. |
|
2912 |
f exists ifFalse:[^ nil]. |
|
2913 |
||
2914 |
fn := f pathName. |
|
2915 |
zar := self new. |
|
2916 |
zar setArchiveStartPosition: startOfArchive endPosition: endOfArchive. |
|
2917 |
zar name:fn mode:#read. |
|
2918 |
^ zar |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2919 |
! ! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2920 |
|
1985 | 2921 |
!ZipArchive class methodsFor:'Signal constants'! |
2922 |
||
2088 | 2923 |
unsupportedZipFileFormatErrorSignal |
2924 |
^ UnsupportedZipFileFormatErrorSignal |
|
2925 |
! |
|
2926 |
||
1985 | 2927 |
zipFileFormatErrorSignal |
2928 |
^ ZipFileFormatErrorSignal |
|
2929 |
! ! |
|
2930 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2931 |
!ZipArchive class methodsFor:'class initialization'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2932 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2933 |
initialize |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2934 |
ECREC_SIZE := 18. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2935 |
LREC_SIZE := 26. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2936 |
CREC_SIZE := 42. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2937 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2938 |
TOTAL_ENTRIES_CENTRAL_DIR := 10. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2939 |
SIZE_CENTRAL_DIRECTORY := 12. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2940 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2941 |
C_COMPRESSED_SIZE := 16. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2942 |
C_UNCOMPRESSED_SIZE := 20. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2943 |
C_FILENAME_LENGTH := 24. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2944 |
C_RELATIVE_OFFSET_LOCAL_HEADER := 38. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2945 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2946 |
C_LOCALHEADERSIGNATURE := 16r04034b50. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2947 |
C_CENTRALHEADERSIGNATURE := 16r02014b50. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2948 |
C_CENTRALENDSIGNATURE := 16r06054b50. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2949 |
|
2088 | 2950 |
EXTERNALFILEATTRIBUTES_ISFILE := 32. |
2951 |
EXTERNALFILEATTRIBUTES_ISDIRECTORY := 16. |
|
2952 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2953 |
"/ compression methods |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2954 |
COMPR_STORED := 0. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2955 |
COMPR_SHRUNK := 1. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2956 |
COMPR_REDUCED1 := 2. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2957 |
COMPR_REDUCED2 := 3. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2958 |
COMPR_REDUCED3 := 4. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2959 |
COMPR_REDUCED4 := 5. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2960 |
COMPR_IMPLODED := 6. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2961 |
COMPR_TOKENIZED := 7. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2962 |
COMPR_DEFLATED := 8. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2963 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2964 |
ZipFileFormatErrorSignal isNil ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2965 |
ZipFileFormatErrorSignal := Error newSignalMayProceed:true. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2966 |
ZipFileFormatErrorSignal nameClass:self message:#zipFileFormatErrorSignal. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2967 |
ZipFileFormatErrorSignal notifierString:'unrecognized/bad zip file format'. |
2088 | 2968 |
|
2104 | 2969 |
UnsupportedZipFileFormatErrorSignal := ZipFileFormatErrorSignal newSignal. |
2088 | 2970 |
UnsupportedZipFileFormatErrorSignal nameClass:self message:#unsupportedZipFileFormatErrorSignal. |
2971 |
UnsupportedZipFileFormatErrorSignal notifierString:'unsupported zip file format'. |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2972 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2973 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2974 |
Lobby isNil ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2975 |
Lobby := Registry new. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2976 |
]. |
2088 | 2977 |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2978 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2979 |
self initialize |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2980 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2981 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2982 |
"Modified: / 29.3.1998 / 20:17:18 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2983 |
! ! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2984 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2985 |
!ZipArchive class methodsFor:'cleanup'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2986 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2987 |
flush |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2988 |
"forget about cached zipArchives" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2989 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2990 |
RecentlyUsedZipArchives := nil. FlushBlock := nil. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2991 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2992 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2993 |
self flush |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2994 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2995 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2996 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2997 |
installFlushBlock |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2998 |
"forget about cached zipArchives" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
2999 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3000 |
FlushBlock isNil ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3001 |
FlushBlock := [ RecentlyUsedZipArchives := nil. FlushBlock := nil. ]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3002 |
] ifFalse:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3003 |
Processor removeTimedBlock:FlushBlock. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3004 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3005 |
Processor addTimedBlock:FlushBlock for:nil afterSeconds:60. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3006 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3007 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3008 |
self installFlushBlock |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3009 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3010 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3011 |
"Created: / 9.4.1998 / 13:17:07 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3012 |
"Modified: / 19.10.1998 / 21:02:22 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3013 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3014 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3015 |
lowSpaceCleanup |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3016 |
"forget about cached zipArchives" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3017 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3018 |
RecentlyUsedZipArchives := nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3019 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3020 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3021 |
self lowSpaceCleanup |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3022 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3023 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3024 |
"Modified: / 7.4.1998 / 17:58:57 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3025 |
! ! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3026 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3027 |
!ZipArchive class methodsFor:'constants'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3028 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3029 |
LREC_SIZE |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3030 |
^ LREC_SIZE |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3031 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3032 |
"Created: / 29.3.1998 / 19:11:20 / cg" |
1994 | 3033 |
! |
3034 |
||
3035 |
centralDirectoryMinimumSize |
|
3036 |
^ 46 |
|
3037 |
||
3038 |
"Created: / 29.3.1998 / 19:11:20 / cg" |
|
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3039 |
! |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3040 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3041 |
streamBufferSize |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3042 |
^ 65536 "/ 1024 * 64 |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3043 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3044 |
"Created: / 29.3.1998 / 19:11:20 / cg" |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3045 |
! ! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3046 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3047 |
!ZipArchive class methodsFor:'debugging'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3048 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3049 |
debugTrace:aBoolean |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3050 |
%{ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3051 |
if (aBoolean == true) { |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3052 |
debugTrace = 1; |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3053 |
} else { |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3054 |
debugTrace = 0; |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3055 |
} |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3056 |
%} |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3057 |
! ! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3058 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3059 |
!ZipArchive methodsFor:'accessing'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3060 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3061 |
entries |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3062 |
"return a collection of fileName entries" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3063 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3064 |
|names| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3065 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3066 |
names := OrderedCollection new. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3067 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3068 |
self zipMembersDo:[:zipd | |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3069 |
names add:(zipd fileName) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3070 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3071 |
^ names |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3072 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3073 |
|
2009 | 3074 |
fileSize |
3075 |
file notNil ifTrue:[ |
|
3076 |
^ file size |
|
3077 |
]. |
|
3078 |
^ 0 |
|
3079 |
! |
|
3080 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3081 |
members |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3082 |
"return a collection of members" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3083 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3084 |
|members| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3085 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3086 |
members := OrderedCollection new. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3087 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3088 |
self zipMembersDo:[:zipd | |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3089 |
members add:zipd |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3090 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3091 |
^ members |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3092 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3093 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3094 |
name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3095 |
"return the (file-)name of this zipArchive" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3096 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3097 |
^ archiveName |
1994 | 3098 |
! |
3099 |
||
3100 |
setArchiveStartPosition: aStartposition endPosition: anEndPosition |
|
3101 |
startOfArchive := aStartposition. |
|
3102 |
endOfArchive := anEndPosition. |
|
2009 | 3103 |
! |
3104 |
||
3105 |
size |
|
3106 |
^self fileSize |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3107 |
! ! |
1980 | 3108 |
|
1981
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
3109 |
!ZipArchive methodsFor:'finalization'! |
1980 | 3110 |
|
1981
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
3111 |
finalizationLobby |
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
3112 |
"answer the registry used for finalization." |
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
3113 |
^ Lobby |
1979 | 3114 |
! |
3115 |
||
1981
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
3116 |
finalize |
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
3117 |
"some Stream has been collected - close the file if not already done" |
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
3118 |
self closeFile |
622 | 3119 |
! ! |
3120 |
||
1980 | 3121 |
!ZipArchive methodsFor:'open/close'! |
622 | 3122 |
|
1981
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
3123 |
close |
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
3124 |
self closeFile |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3125 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3126 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3127 |
name:archiveFileName mode:readOrWriteMode |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3128 |
"open read or writestream on archiveFileName" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3129 |
file notNil ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3130 |
self closeFile. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3131 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3132 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3133 |
archiveName := archiveFileName asFilename name. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3134 |
mode := readOrWriteMode. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3135 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3136 |
mode ~~ #write ifTrue:[ |
1987 | 3137 |
|mustCloseFile| |
3138 |
||
3139 |
mustCloseFile := true. |
|
3140 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3141 |
self openFile. |
1987 | 3142 |
[ |
3143 |
self readDirectory. |
|
3144 |
mustCloseFile := false. |
|
3145 |
] ensure:[ |
|
3146 |
mustCloseFile ifTrue:[self closeFile]. |
|
3147 |
]. |
|
1986 | 3148 |
] ifFalse:[ |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3149 |
self openFile. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3150 |
]. |
622 | 3151 |
! ! |
3152 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3153 |
!ZipArchive methodsFor:'private'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3154 |
|
1993 | 3155 |
addContentsToArchiveFrom: realFileName to: zipFileName compress: aCompressFlag |
2088 | 3156 |
<resource: #obsolete> |
2014
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3157 |
|fromStream zipEntry data archiveData curTime curDate theCompressMethod positionSize |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3158 |
theZipFileName | |
2088 | 3159 |
|
3160 |
"/ sr & cg: |
|
3161 |
"/ is this obsolete ? |
|
3162 |
"/ |
|
3163 |
"/ if not, please refactor by calling |
|
3164 |
"/ self addFile: aFileName fromStream: aStream compressMethod: (aCompressFlag ifTrue:COMPR_DEFLATED ifFalse:COMPR_STORED) asDirectory:false |
|
3165 |
"/ as this is no longer sent, is it still needed ???? |
|
3166 |
||
1993 | 3167 |
aCompressFlag ifTrue: [ |
3168 |
fromStream := realFileName readStream. |
|
2088 | 3169 |
theCompressMethod := COMPR_DEFLATED. |
1993 | 3170 |
] ifFalse: [ |
3171 |
fromStream := realFileName readStream. |
|
2088 | 3172 |
theCompressMethod := COMPR_STORED. |
1993 | 3173 |
]. |
3174 |
||
3175 |
fromStream isNil ifTrue: [ |
|
3176 |
^ self error: 'Could not open: ', realFileName name,' for reading ...'. |
|
3177 |
]. |
|
3178 |
||
3179 |
(file isNil or: [mode ~~ #write]) ifTrue: [ |
|
3180 |
^ self error: 'Archiv not open for writing ...'. |
|
3181 |
]. |
|
3182 |
||
3183 |
zipEntry := ZipMember new default. |
|
3184 |
||
3185 |
firstEntry isNil ifTrue: [ |
|
3186 |
firstEntry := zipEntry. |
|
3187 |
] ifFalse: [ |
|
3188 |
lastEntry next: zipEntry. |
|
3189 |
]. |
|
3190 |
||
3191 |
lastEntry := zipEntry. |
|
3192 |
||
2014
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3193 |
theZipFileName := self validZipFileNameFrom:zipFileName. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3194 |
|
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3195 |
zipEntry fileName: theZipFileName. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3196 |
zipEntry fileNameLength: theZipFileName size. |
1993 | 3197 |
zipEntry uncompressedSize: 0. |
3198 |
||
3199 |
zipEntry compressionMethod: theCompressMethod. |
|
3200 |
zipEntry internalFileAttributes: 1. |
|
2088 | 3201 |
zipEntry externalFileAttributes: EXTERNALFILEATTRIBUTES_ISFILE. |
1993 | 3202 |
|
3203 |
curTime := Time now. |
|
3204 |
curDate := Date today. |
|
3205 |
"/ data and time in msdos format |
|
3206 |
zipEntry lastModFileTime: (((curTime seconds // 2) bitOr: (curTime minutes rightShift: -5)) bitOr: (curTime hours rightShift: -11)). |
|
3207 |
zipEntry lastModFileDate: (((curDate day) bitOr: (curDate month rightShift: -5)) bitOr: (((curDate year) - 1980) rightShift: -9)). |
|
3208 |
||
3209 |
data notEmptyOrNil ifTrue: [ |
|
3210 |
"/ crc32 is allways reqired (not as written in docu to be zero in case of uncompressed mode) |
|
3211 |
zipEntry crc32: (ZipStream crc32BytesIn: data). |
|
3212 |
]. |
|
3213 |
||
2088 | 3214 |
(theCompressMethod == COMPR_DEFLATED) ifTrue: [ |
1993 | 3215 |
|tmpCompressedData tmpCompressedDataSize| |
2088 | 3216 |
|
1993 | 3217 |
tmpCompressedData := ByteArray new:(data size + 16). "/ if the compression is less then the additional overhead we need more space in buffer |
3218 |
tmpCompressedDataSize := ZipStream compress:data into:tmpCompressedData. |
|
3219 |
||
3220 |
zipEntry compressedSize: (tmpCompressedDataSize - 6). "/6 = the zlib specific data 2 bytes in front and 4 bytes behind the real data |
|
3221 |
archiveData := tmpCompressedData copyFrom: 3. "/ 2 bytes before the real data |
|
3222 |
] ifFalse: [ |
|
3223 |
zipEntry compressedSize: zipEntry uncompressedSize. |
|
3224 |
archiveData := data. |
|
3225 |
]. |
|
3226 |
||
3227 |
"/ ensure that the file position is at the end |
|
3228 |
file setToEnd. |
|
3229 |
||
3230 |
zipEntry relativeLocalHeaderOffset:(file position). |
|
3231 |
file nextPutLong: 16r04034b50 MSB:false. |
|
3232 |
file nextPutShort:zipEntry versionNeedToExtract MSB:false. |
|
3233 |
file nextPutShort:zipEntry generalPurposBitFlag MSB:false. |
|
3234 |
file nextPutShort:zipEntry compressionMethod MSB:false. |
|
3235 |
file nextPutShort:zipEntry lastModFileTime MSB:false. |
|
3236 |
file nextPutShort:zipEntry lastModFileDate MSB:false. |
|
3237 |
file nextPutLong:zipEntry crc32 MSB:false. |
|
3238 |
"/ remember the position where the size of the data should be written |
|
3239 |
positionSize := file position. |
|
3240 |
file nextPutLong:zipEntry compressedSize MSB:false. |
|
3241 |
file nextPutLong:zipEntry uncompressedSize MSB:false. |
|
3242 |
file nextPutShort:zipEntry fileNameLength MSB:false. |
|
3243 |
file nextPutShort:zipEntry extraFieldLength MSB:false. |
|
3244 |
file nextPutAll:zipEntry fileName. |
|
3245 |
zipEntry extraField notNil ifTrue: [ |
|
3246 |
file nextPutAll:zipEntry extraField. |
|
3247 |
]. |
|
3248 |
||
3249 |
archiveData notNil ifTrue: [ |
|
3250 |
file nextPutBytes: zipEntry compressedSize from: archiveData. |
|
3251 |
]. |
|
3252 |
||
3253 |
zipEntry compressedSize: data size. |
|
3254 |
zipEntry uncompressedSize: data size. |
|
3255 |
||
3256 |
" set filepointer back to position where the size of the contents should be written |
|
3257 |
" |
|
3258 |
file position: positionSize. |
|
3259 |
||
3260 |
file nextPutLong:zipEntry compressedSize MSB:false. |
|
3261 |
file nextPutLong:zipEntry uncompressedSize MSB:false. |
|
3262 |
||
3263 |
file setToEnd. |
|
3264 |
^ true |
|
3265 |
! |
|
3266 |
||
3267 |
addFile: aFileName withContents: data compressed: doCompressFlag |
|
2088 | 3268 |
<resource: #obsolete> |
3269 |
"/ sr & cg: |
|
3270 |
"/ is this obsolete ? |
|
3271 |
||
3272 |
^ self |
|
3273 |
addFile: aFileName |
|
3274 |
withContents: data |
|
3275 |
compressMethod:(doCompressFlag ifTrue:COMPR_DEFLATED ifFalse:COMPR_STORED) |
|
3276 |
asDirectory: false. |
|
1993 | 3277 |
! |
3278 |
||
1986 | 3279 |
checkZipArchive:archiveFileName |
3280 |
|isValidArchive| |
|
3281 |
||
3282 |
archiveName := archiveFileName asFilename name. |
|
1987 | 3283 |
isValidArchive := false. |
1986 | 3284 |
mode := #read. |
3285 |
self openFile. |
|
1987 | 3286 |
|
3287 |
[ |
|
3288 |
isValidArchive := self checkZipArchive. |
|
3289 |
] ensure:[ |
|
3290 |
self closeFile. |
|
3291 |
]. |
|
1986 | 3292 |
^ isValidArchive |
3293 |
! |
|
3294 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3295 |
closeFile |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3296 |
"close the stream - tell operating system" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3297 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3298 |
file notNil ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3299 |
Lobby unregister:self. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3300 |
mode == #write ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3301 |
self addCentralZipDirectory |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3302 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3303 |
file close. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3304 |
file := nil. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3305 |
] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3306 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3307 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3308 |
openFile |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3309 |
|fn| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3310 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3311 |
file isNil ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3312 |
fn := archiveName asFilename. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3313 |
mode ~~ #write ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3314 |
file := fn readStream. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3315 |
] ifFalse:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3316 |
file := fn writeStream |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3317 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3318 |
file binary. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3319 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3320 |
Lobby register:self. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3321 |
]. |
1994 | 3322 |
! |
3323 |
||
3324 |
setDefaultArchiveBounds |
|
3325 |
" set start and end of archive if it is nil. That means no bounds was defined |
|
3326 |
before. In that case the archive is the complete file. |
|
3327 |
" |
|
3328 |
startOfArchive isNil ifTrue: [ |
|
3329 |
"/ set archive zero position |
|
3330 |
file reset. |
|
3331 |
startOfArchive := file position. |
|
3332 |
]. |
|
3333 |
||
3334 |
endOfArchive isNil ifTrue: [ |
|
3335 |
"/ set archive end position |
|
3336 |
file setToEnd. |
|
3337 |
endOfArchive := file position. |
|
3338 |
]. |
|
2014
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3339 |
! |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3340 |
|
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3341 |
validZipFileNameFrom:zipFileName |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3342 |
|fileNameParts partCol partOfPartCol validZipFileName theElement| |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3343 |
fileNameParts := OrderedCollection new. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3344 |
|
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3345 |
partCol := zipFileName asCollectionOfSubstringsSeparatedBy:$\. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3346 |
partCol do:[:aSegm| |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3347 |
partOfPartCol := aSegm asCollectionOfSubstringsSeparatedBy:$/. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3348 |
partOfPartCol do:[:nextSegm| |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3349 |
fileNameParts add: nextSegm. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3350 |
]. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3351 |
]. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3352 |
|
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3353 |
fileNameParts do:[:anElement| |
2088 | 3354 |
anElement notEmptyOrNil ifTrue:[ |
3355 |
theElement := anElement. |
|
3356 |
"/ disabled by sr - no reason to not allow spaces in a fileName |
|
3357 |
"/ (anElement includes:$ ) ifTrue:[ |
|
3358 |
"/ theElement := (anElement replString:' ' withString:''). |
|
3359 |
"/ ]. |
|
3360 |
||
2014
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3361 |
validZipFileName isNil ifTrue:[ |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3362 |
validZipFileName := theElement. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3363 |
] ifFalse:[ |
2015 | 3364 |
validZipFileName := (validZipFileName, '/', theElement). |
2014
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3365 |
]. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3366 |
]. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3367 |
]. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3368 |
|
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3369 |
validZipFileName isEmptyOrNil ifTrue:[ |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3370 |
^ ZipFileFormatErrorSignal raiseRequestErrorString: (' - invalid zip file name ', zipFileName). |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3371 |
]. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3372 |
|
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3373 |
^ validZipFileName |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3374 |
|
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3375 |
" |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3376 |
ZipArchive new validZipFileNameFrom:'hello//world' |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3377 |
ZipArchive new validZipFileNameFrom:'hello\\world' |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3378 |
ZipArchive new validZipFileNameFrom:'hello\/world' |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3379 |
ZipArchive new validZipFileNameFrom:'hello/\world' |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3380 |
ZipArchive new validZipFileNameFrom:'hello/\world/aaa bbb/ccc' |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
3381 |
" |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3382 |
! ! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3383 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3384 |
!ZipArchive methodsFor:'private-decompression'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3385 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3386 |
decode:rawBytes method:compressionMethod size:uncompressedSize |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3387 |
|outBytes| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3388 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3389 |
compressionMethod == COMPR_STORED ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3390 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3391 |
"/ uncompressed |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3392 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3393 |
^ rawBytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3394 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3395 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3396 |
compressionMethod == COMPR_DEFLATED ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3397 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3398 |
"/ deflate/inflate algorithm |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3399 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3400 |
outBytes := ByteArray new:uncompressedSize. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3401 |
^ self inflate:rawBytes to:outBytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3402 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3403 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3404 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3405 |
"/ the other algorithms are not (yet) supported |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3406 |
"/ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3407 |
compressionMethod == COMPR_SHRUNK ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3408 |
self error:'unsupported compression method: SHRUNK'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3409 |
^ nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3410 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3411 |
compressionMethod == COMPR_REDUCED1 ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3412 |
self error:'unsupported compression method: REDUCED1'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3413 |
^ nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3414 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3415 |
compressionMethod == COMPR_REDUCED2 ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3416 |
self error:'unsupported compression method: REDUCED2'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3417 |
^ nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3418 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3419 |
compressionMethod == COMPR_REDUCED3 ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3420 |
self error:'unsupported compression method: REDUCED3'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3421 |
^ nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3422 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3423 |
compressionMethod == COMPR_REDUCED4 ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3424 |
self error:'unsupported compression method: REDUCED4'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3425 |
^ nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3426 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3427 |
compressionMethod == COMPR_IMPLODED ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3428 |
self error:'unsupported compression method: IMPLODED'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3429 |
^ nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3430 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3431 |
compressionMethod == COMPR_TOKENIZED ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3432 |
self error:'unsupported compression method: TOKENIZED'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3433 |
^ nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3434 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3435 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3436 |
self error:'unsupported compression method'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3437 |
^ nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3438 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3439 |
"Created: / 29.3.1998 / 20:14:45 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3440 |
"Modified: / 8.4.1998 / 10:31:34 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3441 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3442 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3443 |
inflate:inBytes to:outBytes |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3444 |
|inflateReturnCode| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3445 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3446 |
%{ /* STACK:32768 */ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3447 |
if (__isByteArray(inBytes) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3448 |
&& __isByteArray(outBytes)) { |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3449 |
char *in, *out; |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3450 |
int rc; |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3451 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3452 |
in = __ByteArrayInstPtr(inBytes)->ba_element; |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3453 |
out = __ByteArrayInstPtr(outBytes)->ba_element; |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3454 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3455 |
if ((rc = stx_inflate(in, out)) == 0) { |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3456 |
RETURN (outBytes); |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3457 |
} |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3458 |
inflateReturnCode = __MKSMALLINT(rc); |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3459 |
} |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3460 |
%}. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3461 |
inflateReturnCode notNil ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3462 |
"/ bad blockType 2 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3463 |
self error:'inflate error: ' , inflateReturnCode printString |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3464 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3465 |
^ nil. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3466 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3467 |
"Created: / 8.4.1998 / 10:31:27 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3468 |
! ! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3469 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3470 |
!ZipArchive methodsFor:'private-directory stuff'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3471 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3472 |
addCentralZipDirectory |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3473 |
|zipEntry noEntries| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3474 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3475 |
centralDirectory isNil ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3476 |
centralDirectory := ZipCentralDirectory new default. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3477 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3478 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3479 |
noEntries := 0. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3480 |
zipEntry := firstEntry. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3481 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3482 |
"/ ensure that the file position is at end |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3483 |
file setToEnd. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3484 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3485 |
centralDirectory centralDirectoryStartOffset: file position. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3486 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3487 |
[ zipEntry notNil ] whileTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3488 |
noEntries := noEntries + 1. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3489 |
file nextPutLong: C_CENTRALHEADERSIGNATURE MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3490 |
file nextPutShort:zipEntry versionMadeBy MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3491 |
file nextPutShort:zipEntry versionNeedToExtract MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3492 |
file nextPutShort:zipEntry generalPurposBitFlag MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3493 |
file nextPutShort:zipEntry compressionMethod MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3494 |
file nextPutShort:zipEntry lastModFileTime MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3495 |
file nextPutShort:zipEntry lastModFileDate MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3496 |
file nextPutLong:zipEntry crc32 MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3497 |
file nextPutLong:zipEntry compressedSize MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3498 |
file nextPutLong:zipEntry uncompressedSize MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3499 |
file nextPutShort:zipEntry fileNameLength MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3500 |
file nextPutShort:zipEntry extraFieldLength MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3501 |
file nextPutShort:zipEntry fileCommentLength MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3502 |
file nextPutShort:zipEntry diskNumberStart MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3503 |
file nextPutShort:zipEntry internalFileAttributes MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3504 |
file nextPutLong:zipEntry externalFileAttributes MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3505 |
file nextPutLong:zipEntry relativeLocalHeaderOffset MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3506 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3507 |
file nextPutAll:zipEntry fileName. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3508 |
zipEntry extraField notNil ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3509 |
file nextPutAll:zipEntry extraField. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3510 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3511 |
zipEntry fileComment notNil ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3512 |
file nextPutAll:zipEntry fileComment. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3513 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3514 |
zipEntry := zipEntry next. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3515 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3516 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3517 |
centralDirectory centralDirectoryTotalNoOfEntries: noEntries. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3518 |
centralDirectory centralDirectoryTotalNoOfEntriesOnThisDisk: noEntries. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3519 |
centralDirectory centralDirectorySize: (file position) - (centralDirectory centralDirectoryStartOffset). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3520 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3521 |
file nextPutByte:($P codePoint). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3522 |
file nextPutByte:($K codePoint). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3523 |
file nextPutByte:8r005. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3524 |
file nextPutByte:8r006. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3525 |
file nextPutShort:centralDirectory numberOfThisDisk MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3526 |
file nextPutShort:centralDirectory centralDirectoryStartDiskNumber MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3527 |
file nextPutShort:centralDirectory centralDirectoryTotalNoOfEntriesOnThisDisk MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3528 |
file nextPutShort:centralDirectory centralDirectoryTotalNoOfEntries MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3529 |
file nextPutLong:centralDirectory centralDirectorySize MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3530 |
file nextPutLong:centralDirectory centralDirectoryStartOffset MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3531 |
file nextPutShort:centralDirectory zipCommentLength MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3532 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3533 |
centralDirectory zipCommentLength ~~ 0 ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3534 |
file nextPutAll: centralDirectory zipComment. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3535 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3536 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3537 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3538 |
addMember |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3539 |
"add a zipMember" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3540 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3541 |
|zmemb | |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3542 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3543 |
self addMember:(zmemb := ZipMember new). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3544 |
^ zmemb. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3545 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3546 |
"Created: / 29.3.1998 / 18:22:25 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3547 |
"Modified: / 9.9.1998 / 20:33:32 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3548 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3549 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3550 |
addMember:zmemb |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3551 |
"add a zipMember" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3552 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3553 |
(firstEntry == nil) ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3554 |
firstEntry := zmemb |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3555 |
] ifFalse:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3556 |
lastEntry next:zmemb. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3557 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3558 |
lastEntry := zmemb. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3559 |
^ zmemb. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3560 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3561 |
"Modified: / 30.3.1998 / 17:13:20 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3562 |
"Created: / 9.9.1998 / 20:33:06 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3563 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3564 |
|
1986 | 3565 |
checkZipArchive |
3566 |
"read the zip directory into a linked-list of zipMembers" |
|
3567 |
||
1994 | 3568 |
|size count_in| |
1986 | 3569 |
|
3570 |
file isNil ifTrue: [ |
|
3571 |
^ false |
|
3572 |
]. |
|
3573 |
||
1994 | 3574 |
self setDefaultArchiveBounds. |
3575 |
||
3576 |
size := endOfArchive - startOfArchive. |
|
1986 | 3577 |
(size == 0) ifTrue:[ |
3578 |
count_in := 0. |
|
3579 |
^ false |
|
3580 |
]. |
|
3581 |
||
3582 |
(size < (ECREC_SIZE+4)) ifTrue:[ |
|
3583 |
^ false. |
|
3584 |
]. |
|
3585 |
||
1994 | 3586 |
^ self searchForEndOfCentralDirectorySignature |
1986 | 3587 |
! |
3588 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3589 |
findMember:name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3590 |
"find a zipMember by name" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3591 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3592 |
self zipMembersDo:[:zipd | |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3593 |
(zipd fileName = name) ifTrue:[^ zipd]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3594 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3595 |
^ nil |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3596 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3597 |
"Modified: / 30.3.1998 / 17:13:30 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3598 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3599 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3600 |
readDirectory |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3601 |
"read the zip directory into a linked-list of zipMembers" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3602 |
|
1994 | 3603 |
|size count_in pos0 dataString| |
3604 |
||
3605 |
self setDefaultArchiveBounds. |
|
3606 |
||
3607 |
"/ size := file fileSize. |
|
3608 |
size := endOfArchive - startOfArchive. |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3609 |
(size == 0) ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3610 |
count_in := 0. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3611 |
^ self |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3612 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3613 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3614 |
(size < (ECREC_SIZE+4)) ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3615 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - zipfile too short'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3616 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3617 |
|
1994 | 3618 |
self searchForEndOfCentralDirectorySignature ifFalse: [ |
3619 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - could not find end of directory signature'. |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3620 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3621 |
|
1994 | 3622 |
"/ position before end of central directory signature |
3623 |
pos0 := file position0Based - 4. |
|
3624 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3625 |
"/ Now we have found the end of central directory record |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3626 |
centralDirectory := ZipCentralDirectory new. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3627 |
centralDirectory numberOfThisDisk:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3628 |
centralDirectory centralDirectoryStartDiskNumber:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3629 |
centralDirectory centralDirectoryTotalNoOfEntriesOnThisDisk:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3630 |
centralDirectory centralDirectoryTotalNoOfEntries:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3631 |
centralDirectory centralDirectorySize:(file nextLongMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3632 |
centralDirectory centralDirectoryStartOffset:(file nextLongMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3633 |
centralDirectory zipCommentLength:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3634 |
centralDirectory zipCommentLength ~~ 0 ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3635 |
"/ read zip comment |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3636 |
centralDirectory zipComment:(dataString := String new:(centralDirectory zipCommentLength)). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3637 |
file nextBytes:(centralDirectory zipCommentLength) into:dataString. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3638 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3639 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3640 |
"/ set file position to start of central directory |
1994 | 3641 |
(pos0 - (centralDirectory centralDirectorySize)) < startOfArchive ifTrue: [ |
3642 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - central directory start is out of the archive bounds'. |
|
3643 |
]. |
|
3644 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3645 |
file position0Based:(pos0 - (centralDirectory centralDirectorySize)). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3646 |
count_in := centralDirectory centralDirectoryTotalNoOfEntries. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3647 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3648 |
EndOfStreamNotification handle:[:ex| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3649 |
self warn:'ZipArchive: file format error or short file: ' , |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3650 |
(file isFileStream ifTrue:[file pathName] ifFalse:['inStream']). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3651 |
^ self. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3652 |
] do:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3653 |
"/ read central directory entries |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3654 |
0 to:(count_in-1) do:[:i | |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3655 |
|zipd filename_length centralFileHeaderSignature relative_offset_local_header |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3656 |
posOfNextMember extra crcBytes| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3657 |
|
1994 | 3658 |
(file position + (self class centralDirectoryMinimumSize)) > endOfArchive ifTrue: [ |
3659 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - central directory entry out of archive bounds'. |
|
3660 |
]. |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3661 |
centralFileHeaderSignature := file nextLongMSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3662 |
centralFileHeaderSignature ~= C_CENTRALHEADERSIGNATURE ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3663 |
self warn:'ZipArchive: file format error - bad centralHeaderSignature in:' , |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3664 |
(file isFileStream ifTrue:[file pathName] ifFalse:['inStream']). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3665 |
^ self. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3666 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3667 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3668 |
zipd := ZipMember new. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3669 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3670 |
zipd versionMadeBy:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3671 |
zipd versionNeedToExtract:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3672 |
zipd generalPurposBitFlag:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3673 |
zipd compressionMethod:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3674 |
zipd lastModFileTime:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3675 |
zipd lastModFileDate:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3676 |
"/ next long did not work because it could be in that case a signed small integer |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3677 |
crcBytes := ByteArray with:file next with:file next with:file next with:file next. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3678 |
zipd crc32: (LargeInteger digitBytes: crcBytes MSB: false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3679 |
zipd compressedSize:(file nextLongMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3680 |
zipd uncompressedSize:(file nextLongMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3681 |
zipd fileNameLength:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3682 |
zipd extraFieldLength:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3683 |
zipd fileCommentLength:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3684 |
zipd diskNumberStart:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3685 |
zipd internalFileAttributes:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3686 |
zipd externalFileAttributes:(file nextLongMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3687 |
zipd relativeLocalHeaderOffset:(file nextLongMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3688 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3689 |
filename_length := zipd fileNameLength. |
1994 | 3690 |
(file position + filename_length) > endOfArchive ifTrue: [ |
3691 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - central directory entry out of archive bounds'. |
|
3692 |
]. |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3693 |
"/ read file name |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3694 |
zipd fileName:(dataString := String new:filename_length). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3695 |
file nextBytes:filename_length into:dataString. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3696 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3697 |
zipd extraFieldLength ~~ 0 ifTrue: [ |
1994 | 3698 |
(file position + (zipd extraFieldLength)) > endOfArchive ifTrue: [ |
3699 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - central directory entry out of archive bounds'. |
|
3700 |
]. |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3701 |
"/ read extra field |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3702 |
zipd extraField:(dataString := String new:(zipd extraFieldLength)). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3703 |
file nextBytes:(zipd extraFieldLength) into:dataString. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3704 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3705 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3706 |
zipd fileCommentLength ~~ 0 ifTrue: [ |
1994 | 3707 |
(file position + (zipd fileCommentLength)) > endOfArchive ifTrue: [ |
3708 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - central directory entry out of archive bounds'. |
|
3709 |
]. |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3710 |
"/ read file comment |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3711 |
zipd fileComment:(dataString := String new:(zipd fileCommentLength)). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3712 |
file nextBytes:(zipd fileCommentLength) into:dataString. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3713 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3714 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3715 |
"/ central directory header read is now complete |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3716 |
"/ remember this file position (start of next member) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3717 |
"/ posOfNextMember := file position. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3718 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3719 |
"/ reposition in file to get start of data section |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3720 |
"/ relative_offset_local_header := zipd relativeLocalHeaderOffset. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3721 |
"/ file position0Based:(relative_offset_local_header + 28). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3722 |
"/ extra := file nextUnsignedShortMSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3723 |
"/ zipd dataStart:(relative_offset_local_header + "C_SIZEOFLOCALHEADER" 30 + filename_length + extra ). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3724 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3725 |
"/ reposition in file to next member |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3726 |
"/ file position:posOfNextMember. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3727 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3728 |
self addMember:zipd. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3729 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3730 |
|
1994 | 3731 |
(file position + 6) > endOfArchive ifTrue: [ |
3732 |
"/ archive have no digital signature |
|
3733 |
^ self. |
|
3734 |
]. |
|
3735 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3736 |
"/ check for digital signature |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3737 |
((file next ~~ ($P codePoint)) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3738 |
or:[file next ~~ ($K codePoint) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3739 |
or:[file next ~~ 8r005 |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3740 |
or:[file next ~~ 8r005]]]) ifTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3741 |
centralDirectory digitalSignatureDataSize:(file nextUnsignedShortMSB:false). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3742 |
centralDirectory digitalSignatureDataSize ~~ 0 ifTrue: [ |
1994 | 3743 |
(file position + (centralDirectory digitalSignatureDataSize)) > endOfArchive ifTrue: [ |
3744 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - digital signature entry out of archive bounds'. |
|
3745 |
]. |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3746 |
"/ read digital signature data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3747 |
centralDirectory digitalSignatureData:(dataString := String new:(centralDirectory digitalSignatureDataSize)). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3748 |
file nextBytes:(centralDirectory digitalSignatureDataSize) into:dataString. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3749 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3750 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3751 |
] |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3752 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3753 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3754 |
ZipArchive flush. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3755 |
ZipArchive oldFileNamed:'/usr/lib/jdk1.1.7/lib/classes.zip' |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3756 |
ZipArchive oldFileNamed:'/usr/lib/jdk1.1.8/lib/classes.zip' |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3757 |
" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3758 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3759 |
"Modified: / 19.10.1998 / 21:27:32 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3760 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3761 |
|
1994 | 3762 |
searchForEndOfCentralDirectorySignature |
3763 |
"read the zip directory into a linked-list of zipMembers" |
|
3764 |
||
3765 |
|size foundPK pos0 searchEndPos| |
|
3766 |
||
3767 |
foundPK := false. |
|
3768 |
size := endOfArchive - startOfArchive. |
|
3769 |
file position0Based:(pos0 := size - ECREC_SIZE - 4). |
|
3770 |
||
3771 |
"/ set position to end of central directory record |
|
3772 |
((file next ~~ ($P codePoint)) |
|
3773 |
or:[file next ~~ ($K codePoint) |
|
3774 |
or:[file next ~~ 8r005 |
|
3775 |
or:[file next ~~ 8r006]]]) ifTrue:[ |
|
3776 |
"/ search from end of archive backwards for "end of central directory signature", |
|
3777 |
"/ this is necessary if the archive includes a .ZIP file comment or a digital signature |
|
3778 |
"/ then the end of the directory signature may be on an other position |
|
3779 |
||
3780 |
"/ but the "end of central directory signature" must be located in the |
|
3781 |
"/ last 64k of the archive |
|
3782 |
size > 65536 ifTrue: [ |
|
3783 |
searchEndPos := (endOfArchive - 65536). |
|
3784 |
] ifFalse: [ |
|
3785 |
searchEndPos := startOfArchive. |
|
3786 |
]. |
|
3787 |
||
3788 |
file position0Based: (pos0 := endOfArchive - 4). |
|
3789 |
||
3790 |
[foundPK] whileFalse: [ |
|
3791 |
(file next == ($P codePoint) |
|
3792 |
and:[file next == ($K codePoint) |
|
3793 |
and:[file next == 8r005 |
|
3794 |
and:[file next == 8r006]]]) ifTrue:[ |
|
3795 |
^ true |
|
3796 |
]. |
|
2104 | 3797 |
file position0Based <= searchEndPos ifTrue: [ |
3798 |
^ false. |
|
3799 |
]. |
|
3800 |
pos0 == 0 ifTrue:[ |
|
1994 | 3801 |
^ false. |
3802 |
]. |
|
3803 |
file position0Based: (pos0 := pos0 - 1). |
|
3804 |
]. |
|
3805 |
^ false |
|
3806 |
]. |
|
3807 |
^ true |
|
3808 |
! |
|
3809 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3810 |
zipMembersDo:aBlock |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3811 |
"evaluate aBlock for all zipMembers" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3812 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3813 |
|zipd| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3814 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3815 |
zipd := firstEntry. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3816 |
[zipd notNil] whileTrue:[ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3817 |
aBlock value:zipd. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3818 |
zipd := zipd next |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3819 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3820 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3821 |
"Created: / 29.3.1998 / 19:15:15 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3822 |
"Modified: / 30.3.1998 / 17:13:47 / cg" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3823 |
! ! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3824 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3825 |
!ZipArchive methodsFor:'reading'! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3826 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3827 |
extract:fileName |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3828 |
"extract an entry identified by fileName as a byteArray; |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3829 |
nil on errors" |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3830 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3831 |
|zmemb rawContents data| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3832 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3833 |
(file isNil or: [mode ~~ #read]) ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3834 |
^ self error: 'Archiv not open for reading ...'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3835 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3836 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3837 |
zmemb := self findMember:fileName. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3838 |
zmemb isNil ifTrue:[^ nil]. |
1994 | 3839 |
(zmemb fileStart + startOfArchive) > endOfArchive ifTrue: [ |
3840 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - zipEntry start is out of the archive bounds'. |
|
3841 |
]. |
|
3842 |
||
3843 |
(zmemb fileStart + startOfArchive + (zmemb compressedSize)) > endOfArchive ifTrue: [ |
|
3844 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - zipEntry end is out of the archive bounds'. |
|
3845 |
]. |
|
3846 |
||
3847 |
file position0Based:(zmemb fileStart + startOfArchive). |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3848 |
rawContents := file nextBytes:(zmemb compressedSize). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3849 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3850 |
data := self |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3851 |
decode:rawContents |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3852 |
method:(zmemb compressionMethod) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3853 |
size:(zmemb uncompressedSize). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3854 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
3855 |
^ data. |
1993 | 3856 |
! |
3857 |
||
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3858 |
extract:fileName intoStream: aWriteStream |
2012 | 3859 |
"extract an entry indentified by filename into aWriteStream |
3860 |
return false on error |
|
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3861 |
" |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3862 |
|
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3863 |
|zmemb buffer rdSize nextBlockSize streamBufferSize myZipStream| |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3864 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3865 |
(file isNil or: [mode ~~ #read]) ifTrue: [ |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3866 |
self error: 'Archiv not open for reading ...'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3867 |
^ false |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3868 |
]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3869 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3870 |
zmemb := self findMember:fileName. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3871 |
zmemb isNil ifTrue:[^ false]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3872 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3873 |
(zmemb fileStart + startOfArchive) > endOfArchive ifTrue: [ |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3874 |
ZipFileFormatErrorSignal raiseRequestErrorString:' - zipEntry start is out of the archive bounds'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3875 |
^ false |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3876 |
]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3877 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3878 |
(zmemb fileStart + startOfArchive + (zmemb compressedSize)) > endOfArchive ifTrue: [ |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3879 |
ZipFileFormatErrorSignal raiseRequestErrorString:' - zipEntry end is out of the archive bounds'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3880 |
^ false |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3881 |
]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3882 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3883 |
file position0Based:(zmemb fileStart + startOfArchive). |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3884 |
|
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3885 |
rdSize := zmemb uncompressedSize. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3886 |
streamBufferSize := self class streamBufferSize. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3887 |
buffer := ByteArray new: streamBufferSize. |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3888 |
[ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3889 |
[rdSize > 0] whileTrue: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3890 |
rdSize > (self class streamBufferSize) ifTrue: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3891 |
nextBlockSize := streamBufferSize. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3892 |
] ifFalse: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3893 |
(nextBlockSize := rdSize) > 0 ifTrue: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3894 |
buffer := ByteArray new: nextBlockSize. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3895 |
]. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3896 |
]. |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3897 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3898 |
nextBlockSize > 0 ifTrue: [ |
2088 | 3899 |
zmemb compressionMethod == COMPR_DEFLATED ifTrue:[ |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3900 |
myZipStream isNil ifTrue: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3901 |
file binary. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3902 |
myZipStream := ZipStream readOpenAsZipStreamOn: file. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3903 |
]. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3904 |
buffer := myZipStream next:nextBlockSize. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3905 |
] ifFalse:[ |
2088 | 3906 |
zmemb compressionMethod == COMPR_STORED ifTrue:[ |
3907 |
file nextBytes:nextBlockSize into:buffer startingAt:1. |
|
3908 |
] ifFalse:[ |
|
3909 |
UnsupportedZipFileFormatErrorSignal raiseErrorString:'unsupported compressMethod' |
|
3910 |
]. |
|
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3911 |
]. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3912 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3913 |
aWriteStream nextPutBytes:buffer size from:buffer startingAt:1. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3914 |
]. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3915 |
rdSize := rdSize - nextBlockSize. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3916 |
]. |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3917 |
] ensure:[ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3918 |
myZipStream notNil ifTrue:[ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
3919 |
myZipStream close. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3920 |
]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3921 |
]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3922 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3923 |
^ true. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3924 |
! |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
3925 |
|
1994 | 3926 |
extractArchive:fileName |
2088 | 3927 |
<resource: #obsolete> |
1994 | 3928 |
"extract a filename entry as a byteArray; |
3929 |
nil on errors" |
|
2088 | 3930 |
|
1994 | 3931 |
|zmemb| |
3932 |
||
3933 |
(file isNil or: [mode ~~ #read]) ifTrue: [ |
|
3934 |
^ self error: 'Archiv not open for reading ...'. |
|
3935 |
]. |
|
3936 |
||
3937 |
zmemb := self findMember:fileName. |
|
3938 |
zmemb isNil ifTrue:[^ nil]. |
|
3939 |
(zmemb fileStart + startOfArchive) > endOfArchive ifTrue: [ |
|
3940 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - zipEntry start is out of the archive bounds'. |
|
3941 |
]. |
|
3942 |
||
3943 |
(zmemb fileStart + (zmemb compressedSize)) > endOfArchive ifTrue: [ |
|
3944 |
^ ZipFileFormatErrorSignal raiseRequestErrorString:' - zipEntry end is out of the archive bounds'. |
|
3945 |
]. |
|
3946 |
||
3947 |
"/ open archive and set bounds for the requested archive |
|
3948 |
"/ this can now be handled like an ordenary archive |
|
3949 |
||
3950 |
^ self class oldFileNamed:archiveName |
|
3951 |
startOfArchive:(zmemb fileStart + startOfArchive) |
|
3952 |
endOfArchive:(zmemb fileStart + startOfArchive + (zmemb compressedSize)). |
|
3953 |
! |
|
3954 |
||
2003 | 3955 |
restoreOsDirectory:osDirectoryName fromArchiveDirectory: archiveDirectoryName |
2010
268f51b7c9c7
only restoreOsDirectory:fromArchiveDirectory: if there is
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3956 |
|osDirectory fileNameOrDirectoryEntry directoryAlreadyCreated| |
268f51b7c9c7
only restoreOsDirectory:fromArchiveDirectory: if there is
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3957 |
|
2003 | 3958 |
osDirectory := osDirectoryName asFilename. |
3959 |
(osDirectory exists and: [osDirectory isDirectory not]) ifTrue:[ |
|
3960 |
^ self |
|
3961 |
]. |
|
3962 |
||
2010
268f51b7c9c7
only restoreOsDirectory:fromArchiveDirectory: if there is
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3963 |
directoryAlreadyCreated := false. |
2003 | 3964 |
|
3965 |
self members do: [:aMember| |
|
2012 | 3966 |
|baseName| |
3967 |
||
3968 |
"/ cg: was wrong - was wrong about (isValidPath:'foo), if there is a file named 'foobar' ?!! |
|
3969 |
((aMember fileName = archiveDirectoryName) |
|
3970 |
or:[ aMember fileName startsWith: (archiveDirectoryName,'/') ]) ifTrue: [ |
|
2010
268f51b7c9c7
only restoreOsDirectory:fromArchiveDirectory: if there is
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3971 |
directoryAlreadyCreated ifFalse:[ |
268f51b7c9c7
only restoreOsDirectory:fromArchiveDirectory: if there is
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3972 |
osDirectory exists ifFalse:[ |
268f51b7c9c7
only restoreOsDirectory:fromArchiveDirectory: if there is
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3973 |
osDirectory recursiveMakeDirectory. |
268f51b7c9c7
only restoreOsDirectory:fromArchiveDirectory: if there is
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3974 |
directoryAlreadyCreated := true. |
268f51b7c9c7
only restoreOsDirectory:fromArchiveDirectory: if there is
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3975 |
] |
268f51b7c9c7
only restoreOsDirectory:fromArchiveDirectory: if there is
Claus Gittinger <cg@exept.de>
parents:
2009
diff
changeset
|
3976 |
]. |
2012 | 3977 |
baseName := aMember fileName copyFrom: (archiveDirectoryName size+1). |
2088 | 3978 |
baseName size > 0 ifTrue:[ |
3979 |
baseName first == $/ ifTrue:[ |
|
3980 |
baseName := (baseName from:2) asString. |
|
3981 |
]. |
|
3982 |
]. |
|
2012 | 3983 |
|
3984 |
fileNameOrDirectoryEntry := osDirectory construct:baseName. |
|
3985 |
"/ cg - hugh ??? will never be false, because Filename does not implement isEmpty/notEmpty !!!!!!!! |
|
2003 | 3986 |
fileNameOrDirectoryEntry notEmptyOrNil ifTrue: [ |
2088 | 3987 |
"/ sr&cg: |
3988 |
"/ size==0 is not aq valid indicator of the entry being a directory. |
|
3989 |
"/ use the externalFileAttributes instead |
|
3990 |
"/ aMember compressedSize == 0 ifTrue: [ |
|
3991 |
(aMember externalFileAttributes bitTest:EXTERNALFILEATTRIBUTES_ISDIRECTORY) ifTrue:[ |
|
2003 | 3992 |
fileNameOrDirectoryEntry recursiveMakeDirectory. |
2088 | 3993 |
] ifFalse: [ |
2012 | 3994 |
fileNameOrDirectoryEntry writingFileDo:[:aStream| |
3995 |
self |
|
3996 |
extract: aMember fileName |
|
3997 |
intoStream: aStream. |
|
2003 | 3998 |
]. |
3999 |
]. |
|
4000 |
]. |
|
4001 |
] |
|
4002 |
]. |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4003 |
! ! |
1980 | 4004 |
|
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4005 |
!ZipArchive methodsFor:'reading - stream'! |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4006 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4007 |
readStreamFor:nameOfFileInArchive |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4008 |
"open a stream on archive contents identified by nameOfFileInArchive" |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4009 |
self shouldImplement. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4010 |
! ! |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4011 |
|
2003 | 4012 |
!ZipArchive methodsFor:'testing'! |
4013 |
||
4014 |
isValidPath: anArchivePathName |
|
2012 | 4015 |
^ self members |
4016 |
contains:[:aMember | |
|
4017 |
|fn| |
|
4018 |
||
4019 |
fn := aMember fileName. |
|
4020 |
((fn startsWith:anArchivePathName,'/') or:[(fn = anArchivePathName)]) |
|
2003 | 4021 |
]. |
2012 | 4022 |
|
4023 |
"/ cg: wrong - what about (isValidPath:'foo'), if there is a file named 'foobar' ?!! |
|
4024 |
"/ self members do: [:aMember| |
|
4025 |
"/ (aMember fileName startsWith:anArchivePathName) ifTrue:[ |
|
4026 |
"/ ^ true |
|
4027 |
"/ ]. |
|
4028 |
"/ ]. |
|
4029 |
"/ ^ false |
|
2003 | 4030 |
! ! |
4031 |
||
4032 |
!ZipArchive methodsFor:'writing'! |
|
4033 |
||
4034 |
addArchiveDirectory: archiveDirectoryName fromOsDirectory: osDirectoryName |
|
4035 |
^ self addArchiveDirectory: archiveDirectoryName fromOsDirectory: osDirectoryName compressMethod: 0 |
|
4036 |
! |
|
4037 |
||
4038 |
addArchiveDirectory: archiveDirectoryName fromOsDirectory: osDirectoryName compressMethod: theCompressMethod |
|
4039 |
|osDirectory fileNameOrDirectoryEntry| |
|
2088 | 4040 |
|
2003 | 4041 |
osDirectory := osDirectoryName asFilename. |
4042 |
(osDirectory exists not or:[osDirectory exists not]) ifTrue:[ |
|
4043 |
^ self |
|
1993 | 4044 |
]. |
2003 | 4045 |
|
2161
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4046 |
"do not create directories (isDirectory = true) - they are not compatible between operating systems" |
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4047 |
"/ self addDirectory: archiveDirectoryName. |
2003 | 4048 |
osDirectory recursiveDirectoryContentsDo: [:entry| |
2089 | 4049 |
fileNameOrDirectoryEntry := osDirectory construct: entry. |
2003 | 4050 |
fileNameOrDirectoryEntry isDirectory ifTrue: [ |
2161
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4051 |
"/ self addDirectory: (archiveDirectoryName, '/', entry). |
2003 | 4052 |
] ifFalse: [ |
2089 | 4053 |
fileNameOrDirectoryEntry readingFileDo: [:aStream| |
2003 | 4054 |
self addFile: (archiveDirectoryName, '/', entry) |
4055 |
fromStream: aStream |
|
4056 |
compressMethod: theCompressMethod. |
|
4057 |
]. |
|
4058 |
]. |
|
4059 |
]. |
|
1993 | 4060 |
! |
4061 |
||
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4062 |
addArchiveDirectoryCompressed: archiveDirectoryName fromOsDirectory: osDirectoryName |
2088 | 4063 |
^ self addArchiveDirectory: archiveDirectoryName fromOsDirectory: osDirectoryName compressMethod: COMPR_DEFLATED |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4064 |
! |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4065 |
|
1981
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
4066 |
addDirectory: aDirectoryName |
2161
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4067 |
"do not create directories (isDirectory = true) - they are not compatible between operating systems" |
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4068 |
|
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4069 |
<resource: #obsolete> |
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4070 |
|
1981
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
4071 |
^ self addFile: aDirectoryName withContents: nil compressMethod: 0 asDirectory: true. |
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
4072 |
! |
1979 | 4073 |
|
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4074 |
addFile: aFileName fromStream: aStream |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4075 |
^ self addFile: aFileName fromStream: aStream compressMethod: 0 |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4076 |
! |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4077 |
|
2088 | 4078 |
addFile: aFileName fromStream: aStream compressMethod: theCompressMethodArg |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4079 |
|zipEntry curTime curDate crc32Pos crc32 unCompressedDataSize |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4080 |
compressedDataSize buffer rdSize nextBlockSize streamBufferSize |
2088 | 4081 |
myZipStream startDataPosition theZipFileName theCompressMethod| |
4082 |
||
4083 |
"/ sr & cg: |
|
4084 |
"/ please refactor by calling |
|
4085 |
"/ self addFile: aFileName fromStream: aStream compressMethod: theCompressMethod asDirectory:false |
|
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4086 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4087 |
(file isNil or: [mode ~~ #write]) ifTrue: [ |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4088 |
^ self error: 'Archiv not open for writing ...'. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4089 |
]. |
2088 | 4090 |
|
4091 |
theCompressMethod := theCompressMethodArg. |
|
4092 |
||
4093 |
((theCompressMethod == COMPR_DEFLATED) |
|
4094 |
or:[ theCompressMethod == COMPR_STORED ]) ifFalse:[ |
|
4095 |
UnsupportedZipFileFormatErrorSignal raiseRequestErrorString:'unsupported compressMethod'. |
|
4096 |
"/ if proceeded, write as uncompressed |
|
4097 |
theCompressMethod := COMPR_STORED |
|
4098 |
]. |
|
4099 |
||
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4100 |
zipEntry := ZipMember new default. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4101 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4102 |
firstEntry isNil ifTrue: [ |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4103 |
firstEntry := zipEntry. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4104 |
] ifFalse: [ |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4105 |
lastEntry next: zipEntry. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4106 |
]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4107 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4108 |
lastEntry := zipEntry. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4109 |
|
2014
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
4110 |
theZipFileName := self validZipFileNameFrom:aFileName. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
4111 |
|
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
4112 |
zipEntry fileName: theZipFileName. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
4113 |
zipEntry fileNameLength: theZipFileName size. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4114 |
zipEntry uncompressedSize: 0. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4115 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4116 |
zipEntry compressionMethod: theCompressMethod. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4117 |
zipEntry internalFileAttributes: 1. |
2088 | 4118 |
zipEntry externalFileAttributes: EXTERNALFILEATTRIBUTES_ISFILE. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4119 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4120 |
curTime := Time now. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4121 |
curDate := Date today. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4122 |
"/ data and time in msdos format |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4123 |
zipEntry lastModFileTime: (((curTime seconds // 2) bitOr: (curTime minutes rightShift: -5)) bitOr: (curTime hours rightShift: -11)). |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4124 |
zipEntry lastModFileDate: (((curDate day) bitOr: (curDate month rightShift: -5)) bitOr: (((curDate year) - 1980) rightShift: -9)). |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4125 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4126 |
"/ ensure that the file position is at the end |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4127 |
file setToEnd. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4128 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4129 |
zipEntry relativeLocalHeaderOffset:(file position). |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4130 |
file nextPutLong: 16r04034b50 MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4131 |
file nextPutShort:zipEntry versionNeedToExtract MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4132 |
file nextPutShort:zipEntry generalPurposBitFlag MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4133 |
file nextPutShort:zipEntry compressionMethod MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4134 |
file nextPutShort:zipEntry lastModFileTime MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4135 |
file nextPutShort:zipEntry lastModFileDate MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4136 |
crc32Pos := file position. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4137 |
file nextPutLong:zipEntry crc32 MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4138 |
file nextPutLong:zipEntry compressedSize MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4139 |
file nextPutLong:zipEntry uncompressedSize MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4140 |
file nextPutShort:zipEntry fileNameLength MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4141 |
file nextPutShort:zipEntry extraFieldLength MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4142 |
file nextPutAll:zipEntry fileName. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4143 |
zipEntry extraField notNil ifTrue: [ |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4144 |
file nextPutAll:zipEntry extraField. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4145 |
]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4146 |
|
2003 | 4147 |
crc32 := 0. |
4148 |
streamBufferSize := self class streamBufferSize. |
|
4149 |
buffer := ByteArray new: streamBufferSize. |
|
4150 |
rdSize := aStream size. |
|
4151 |
unCompressedDataSize := rdSize. |
|
4152 |
compressedDataSize := 0. |
|
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4153 |
startDataPosition := file position. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4154 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4155 |
[ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4156 |
[rdSize > 0] whileTrue: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4157 |
rdSize > (self class streamBufferSize) ifTrue: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4158 |
nextBlockSize := streamBufferSize. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4159 |
] ifFalse: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4160 |
(nextBlockSize := rdSize) > 0 ifTrue:[ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4161 |
buffer := ByteArray new: nextBlockSize. |
2003 | 4162 |
]. |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4163 |
]. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4164 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4165 |
nextBlockSize > 0 ifTrue: [ |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4166 |
aStream nextBytes:nextBlockSize into:buffer startingAt:1. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4167 |
crc32 := (ZipStream crc32BytesIn: buffer crc: crc32). |
2088 | 4168 |
(theCompressMethod == COMPR_DEFLATED) ifTrue: [ |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4169 |
myZipStream isNil ifTrue: [ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4170 |
myZipStream := ZipStream writeOpenAsZipStreamOn: file. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4171 |
]. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4172 |
myZipStream nextPutBytes:nextBlockSize from:buffer startingAt:1. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4173 |
] ifFalse: [ |
2088 | 4174 |
(theCompressMethod == COMPR_STORED) ifTrue: [ |
4175 |
file nextPutBytes:nextBlockSize from:buffer startingAt:1. |
|
4176 |
] ifFalse:[ |
|
2089 | 4177 |
self error "/ cannot happen |
2088 | 4178 |
] |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4179 |
]. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4180 |
]. |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4181 |
rdSize := rdSize - nextBlockSize. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4182 |
]. |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4183 |
] ensure:[ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4184 |
myZipStream notNil ifTrue:[ |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4185 |
myZipStream close. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4186 |
]. |
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4187 |
]. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4188 |
|
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4189 |
zipEntry compressedSize: (file position) - startDataPosition. |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4190 |
|
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4191 |
zipEntry crc32: crc32. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4192 |
zipEntry uncompressedSize: unCompressedDataSize. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4193 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4194 |
file position0Based:crc32Pos. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4195 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4196 |
file nextPutLong:zipEntry crc32 MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4197 |
file nextPutLong:zipEntry compressedSize MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4198 |
file nextPutLong:zipEntry uncompressedSize MSB:false. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4199 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4200 |
file setToEnd. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4201 |
! |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4202 |
|
1981
c01df511bf6d
add finalize for close by garbage collector extend interface for
ab
parents:
1980
diff
changeset
|
4203 |
addFile: aFileName withContents: data |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4204 |
^ self addFile: aFileName withContents: data compressMethod: 0 asDirectory: false. |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4205 |
! |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4206 |
|
2088 | 4207 |
addFile: aFileName withContents: data compressMethod: theCompressMethodArg asDirectory: isDirectory |
2161
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4208 |
"do not create directories (isDirectory = true) - they are not compatible between operating systems" |
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4209 |
|
2088 | 4210 |
|zipEntry theCompressedData curTime curDate theZipFileName theCompressMethod| |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4211 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4212 |
(file isNil or: [mode ~~ #write]) ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4213 |
^ self error: 'Archiv not open for writing ...'. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4214 |
]. |
2088 | 4215 |
|
4216 |
theCompressMethod := theCompressMethodArg. |
|
4217 |
((theCompressMethod == COMPR_DEFLATED) |
|
4218 |
or:[ theCompressMethod == COMPR_STORED ]) ifFalse:[ |
|
4219 |
UnsupportedZipFileFormatErrorSignal raiseRequestErrorString:'unsupported compressMethod'. |
|
4220 |
"/ if proceeded, write as uncompressed |
|
4221 |
theCompressMethod := COMPR_STORED |
|
4222 |
]. |
|
4223 |
||
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4224 |
zipEntry := ZipMember new default. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4225 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4226 |
firstEntry isNil ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4227 |
firstEntry := zipEntry. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4228 |
] ifFalse: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4229 |
lastEntry next: zipEntry. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4230 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4231 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4232 |
lastEntry := zipEntry. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4233 |
|
2014
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
4234 |
theZipFileName := self validZipFileNameFrom:aFileName. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
4235 |
|
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
4236 |
zipEntry fileName: theZipFileName. |
929753038c13
ensure that zip file name is valid before save (check // \\ and spaces)
ab
parents:
2012
diff
changeset
|
4237 |
zipEntry fileNameLength: theZipFileName size. |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4238 |
zipEntry uncompressedSize: data size. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4239 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4240 |
isDirectory ifTrue: [ |
2088 | 4241 |
zipEntry externalFileAttributes: EXTERNALFILEATTRIBUTES_ISDIRECTORY. |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4242 |
] ifFalse: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4243 |
zipEntry compressionMethod: theCompressMethod. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4244 |
zipEntry internalFileAttributes: 1. |
2088 | 4245 |
zipEntry externalFileAttributes: EXTERNALFILEATTRIBUTES_ISFILE. |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4246 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4247 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4248 |
curTime := Time now. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4249 |
curDate := Date today. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4250 |
"/ data and time in msdos format |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4251 |
zipEntry lastModFileTime: (((curTime seconds // 2) bitOr: (curTime minutes rightShift: -5)) bitOr: (curTime hours rightShift: -11)). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4252 |
zipEntry lastModFileDate: (((curDate day) bitOr: (curDate month rightShift: -5)) bitOr: (((curDate year) - 1980) rightShift: -9)). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4253 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4254 |
data notEmptyOrNil ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4255 |
"/ crc32 is allways reqired (not as written in docu to be zero in case of uncompressed mode) |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4256 |
zipEntry crc32: (ZipStream crc32BytesIn: data). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4257 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4258 |
|
2088 | 4259 |
(isDirectory not and: [theCompressMethod == COMPR_DEFLATED]) ifTrue: [ |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4260 |
|tmpCompressedData tmpCompressedDataSize| |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4261 |
tmpCompressedData := ByteArray new:(data size + 16). "/ if the compression is less then the additional overhead we need more space in buffer |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4262 |
tmpCompressedDataSize := ZipStream compress:data into:tmpCompressedData. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4263 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4264 |
zipEntry compressedSize: (tmpCompressedDataSize - 6). "/6 = the zlib specific data 2 bytes in front and 4 bytes behind the real data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4265 |
theCompressedData := tmpCompressedData copyFrom: 3. "/ 2 bytes before the real data |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4266 |
] ifFalse: [ |
2088 | 4267 |
theCompressMethod == COMPR_STORED ifTrue:[ |
4268 |
zipEntry compressedSize: zipEntry uncompressedSize. |
|
4269 |
theCompressedData := data. |
|
4270 |
] ifFalse:[ |
|
2089 | 4271 |
self error "/ cannot happen |
2088 | 4272 |
]. |
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4273 |
]. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4274 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4275 |
"/ ensure that the file position is at the end |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4276 |
file setToEnd. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4277 |
|
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4278 |
zipEntry relativeLocalHeaderOffset:(file position). |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4279 |
file nextPutLong: 16r04034b50 MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4280 |
file nextPutShort:zipEntry versionNeedToExtract MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4281 |
file nextPutShort:zipEntry generalPurposBitFlag MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4282 |
file nextPutShort:zipEntry compressionMethod MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4283 |
file nextPutShort:zipEntry lastModFileTime MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4284 |
file nextPutShort:zipEntry lastModFileDate MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4285 |
file nextPutLong:zipEntry crc32 MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4286 |
file nextPutLong:zipEntry compressedSize MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4287 |
file nextPutLong:zipEntry uncompressedSize MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4288 |
file nextPutShort:zipEntry fileNameLength MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4289 |
file nextPutShort:zipEntry extraFieldLength MSB:false. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4290 |
file nextPutAll:zipEntry fileName. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4291 |
zipEntry extraField notNil ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4292 |
file nextPutAll:zipEntry extraField. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4293 |
]. |
1993 | 4294 |
|
1983
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4295 |
theCompressedData notNil ifTrue: [ |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4296 |
file nextPutBytes: zipEntry compressedSize from: theCompressedData. |
7792573a6a4f
add finalize for close by garbage collector extend interface for
ab
parents:
1982
diff
changeset
|
4297 |
]. |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4298 |
! |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4299 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4300 |
addFileCompressed: aFileName fromStream: aStream |
2088 | 4301 |
^ self addFile: aFileName fromStream: aStream compressMethod: COMPR_DEFLATED |
2007
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4302 |
! |
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4303 |
|
6659fd3bbfab
support now compressed writing to / reading from a stream
ab
parents:
2003
diff
changeset
|
4304 |
addFileCompressed: aFileName withContents: data |
2088 | 4305 |
^ self addFile: aFileName withContents: data compressMethod: COMPR_DEFLATED asDirectory: false. |
1979 | 4306 |
! ! |
4307 |
||
1995
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4308 |
!ZipArchive methodsFor:'writing - stream'! |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4309 |
|
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4310 |
writeStreamFor:nameOfFileInArchive |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4311 |
"create new entry in central directory" |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4312 |
self shouldImplement. |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4313 |
! ! |
93f2f08bceb3
support now read from and write into archive with streams
ab
parents:
1994
diff
changeset
|
4314 |
|
1979 | 4315 |
!ZipArchive::ZipCentralDirectory methodsFor:'accessing'! |
4316 |
||
4317 |
centralDirectorySize |
|
4318 |
^ centralDirectorySize |
|
4319 |
! |
|
4320 |
||
4321 |
centralDirectorySize:something |
|
4322 |
centralDirectorySize := something. |
|
4323 |
! |
|
4324 |
||
4325 |
centralDirectoryStartDiskNumber |
|
4326 |
^ centralDirectoryStartDiskNumber |
|
4327 |
! |
|
4328 |
||
4329 |
centralDirectoryStartDiskNumber:something |
|
4330 |
centralDirectoryStartDiskNumber := something. |
|
4331 |
! |
|
4332 |
||
4333 |
centralDirectoryStartOffset |
|
4334 |
^ centralDirectoryStartOffset |
|
4335 |
! |
|
4336 |
||
4337 |
centralDirectoryStartOffset:something |
|
4338 |
centralDirectoryStartOffset := something. |
|
4339 |
! |
|
4340 |
||
4341 |
centralDirectoryTotalNoOfEntries |
|
4342 |
^ centralDirectoryTotalNoOfEntries |
|
4343 |
! |
|
4344 |
||
4345 |
centralDirectoryTotalNoOfEntries:something |
|
4346 |
centralDirectoryTotalNoOfEntries := something. |
|
4347 |
! |
|
4348 |
||
4349 |
centralDirectoryTotalNoOfEntriesOnThisDisk |
|
4350 |
^ centralDirectoryTotalNoOfEntriesOnThisDisk |
|
4351 |
! |
|
4352 |
||
4353 |
centralDirectoryTotalNoOfEntriesOnThisDisk:something |
|
4354 |
centralDirectoryTotalNoOfEntriesOnThisDisk := something. |
|
4355 |
! |
|
4356 |
||
4357 |
digitalSignatureData |
|
4358 |
^ digitalSignatureData |
|
4359 |
! |
|
4360 |
||
4361 |
digitalSignatureData:something |
|
4362 |
digitalSignatureData := something. |
|
4363 |
! |
|
4364 |
||
4365 |
digitalSignatureDataSize |
|
4366 |
^ digitalSignatureDataSize |
|
4367 |
! |
|
4368 |
||
4369 |
digitalSignatureDataSize:something |
|
4370 |
digitalSignatureDataSize := something. |
|
4371 |
! |
|
4372 |
||
4373 |
numberOfThisDisk |
|
1993 | 4374 |
^ numberOfThisDisk. |
1979 | 4375 |
! |
4376 |
||
4377 |
numberOfThisDisk:something |
|
4378 |
numberOfThisDisk := something. |
|
4379 |
! |
|
4380 |
||
4381 |
zipComment |
|
4382 |
^ zipComment |
|
4383 |
! |
|
4384 |
||
4385 |
zipComment:something |
|
4386 |
zipComment := something. |
|
4387 |
! |
|
4388 |
||
4389 |
zipCommentLength |
|
4390 |
^ zipCommentLength |
|
4391 |
! |
|
4392 |
||
4393 |
zipCommentLength:something |
|
4394 |
zipCommentLength := something. |
|
4395 |
! ! |
|
4396 |
||
4397 |
!ZipArchive::ZipCentralDirectory methodsFor:'initialize'! |
|
4398 |
||
4399 |
default |
|
4400 |
numberOfThisDisk := 0. |
|
4401 |
centralDirectoryStartDiskNumber := 0. |
|
4402 |
centralDirectoryTotalNoOfEntriesOnThisDisk := 0. |
|
4403 |
centralDirectoryTotalNoOfEntries := 0. |
|
4404 |
centralDirectorySize := 0. |
|
4405 |
centralDirectoryStartOffset := 0. |
|
4406 |
zipCommentLength := 0. |
|
4407 |
zipComment := nil. |
|
4408 |
digitalSignatureDataSize := 0. |
|
4409 |
digitalSignatureData := nil. |
|
4410 |
! ! |
|
4411 |
||
651 | 4412 |
!ZipArchive::ZipMember class methodsFor:'documentation'! |
4413 |
||
4414 |
documentation |
|
4415 |
" |
|
4416 |
keeps some information for a single entry in a zipFile. |
|
4417 |
" |
|
4418 |
||
4419 |
||
4420 |
! ! |
|
4421 |
||
622 | 4422 |
!ZipArchive::ZipMember methodsFor:'accessing'! |
4423 |
||
1979 | 4424 |
compressedSize |
4425 |
^ compressedSize |
|
622 | 4426 |
! |
4427 |
||
1979 | 4428 |
compressedSize:something |
4429 |
compressedSize := something. |
|
622 | 4430 |
! |
4431 |
||
1979 | 4432 |
compressionMethod |
4433 |
^ compressionMethod |
|
622 | 4434 |
! |
4435 |
||
1979 | 4436 |
compressionMethod:something |
4437 |
compressionMethod := something. |
|
622 | 4438 |
! |
4439 |
||
4440 |
crc32 |
|
4441 |
"return the value of the instance variable 'crc32' (automatically generated)" |
|
4442 |
||
4443 |
^ crc32 |
|
4444 |
||
4445 |
"Created: / 29.3.1998 / 20:03:00 / cg" |
|
4446 |
! |
|
4447 |
||
4448 |
crc32:something |
|
4449 |
"set the value of the instance variable 'crc32' (automatically generated)" |
|
4450 |
||
4451 |
crc32 := something. |
|
4452 |
||
4453 |
"Created: / 29.3.1998 / 20:03:00 / cg" |
|
4454 |
! |
|
4455 |
||
638
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4456 |
data |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4457 |
"return the value of the instance variable 'data' (automatically generated)" |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4458 |
|
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4459 |
^ data |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4460 |
|
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4461 |
"Created: / 9.4.1998 / 13:05:03 / cg" |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4462 |
! |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4463 |
|
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4464 |
data:something |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4465 |
"set the value of the instance variable 'data' (automatically generated)" |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4466 |
|
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4467 |
data := something. |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4468 |
|
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4469 |
"Created: / 9.4.1998 / 13:05:03 / cg" |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4470 |
! |
ff61e852f5c3
flush cached data after some time (1 minute)
Claus Gittinger <cg@exept.de>
parents:
637
diff
changeset
|
4471 |
|
938
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4472 |
dataStart |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4473 |
"return the value of the instance variable 'dataStart' (automatically generated)" |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4474 |
|
1979 | 4475 |
dataStart isNil ifTrue: [ |
4476 |
dataStart := relativeLocalHeaderOffset |
|
4477 |
+ "C_SIZEOFLOCALHEADER" 30 |
|
4478 |
+ fileNameLength |
|
4479 |
+ extraFieldLength. |
|
4480 |
]. |
|
938
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4481 |
^ dataStart |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4482 |
"Created: / 29.3.1998 / 18:28:40 / cg" |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4483 |
! |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4484 |
|
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4485 |
dataStart:something |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4486 |
"set the value of the instance variable 'dataStart' (automatically generated)" |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4487 |
|
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4488 |
dataStart := something. |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4489 |
|
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4490 |
"Created: / 29.3.1998 / 18:28:40 / cg" |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4491 |
! |
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4492 |
|
1979 | 4493 |
diskNumberStart |
4494 |
^ diskNumberStart |
|
4495 |
! |
|
4496 |
||
4497 |
diskNumberStart:something |
|
4498 |
diskNumberStart := something. |
|
4499 |
! |
|
4500 |
||
4501 |
externalFileAttributes |
|
4502 |
^ externalFileAttributes |
|
4503 |
! |
|
4504 |
||
4505 |
externalFileAttributes:something |
|
4506 |
externalFileAttributes := something. |
|
4507 |
! |
|
4508 |
||
4509 |
extraField |
|
4510 |
^ extraField |
|
4511 |
! |
|
4512 |
||
4513 |
extraField:something |
|
4514 |
extraField := something. |
|
4515 |
! |
|
4516 |
||
4517 |
extraFieldLength |
|
4518 |
^ extraFieldLength |
|
4519 |
! |
|
4520 |
||
4521 |
extraFieldLength:something |
|
4522 |
extraFieldLength := something. |
|
4523 |
! |
|
4524 |
||
4525 |
fileComment |
|
4526 |
^ fileComment |
|
4527 |
! |
|
4528 |
||
4529 |
fileComment:something |
|
4530 |
fileComment := something. |
|
4531 |
! |
|
4532 |
||
4533 |
fileCommentLength |
|
4534 |
^ fileCommentLength |
|
4535 |
! |
|
4536 |
||
4537 |
fileCommentLength:something |
|
4538 |
fileCommentLength := something. |
|
622 | 4539 |
! |
4540 |
||
1979 | 4541 |
fileName |
4542 |
^ fileName |
|
4543 |
! |
|
4544 |
||
4545 |
fileName:something |
|
4546 |
fileName := something. |
|
4547 |
! |
|
4548 |
||
4549 |
fileNameLength |
|
4550 |
^ fileNameLength |
|
4551 |
! |
|
4552 |
||
4553 |
fileNameLength:something |
|
4554 |
fileNameLength := something. |
|
4555 |
! |
|
4556 |
||
4557 |
generalPurposBitFlag |
|
4558 |
^ generalPurposBitFlag |
|
4559 |
! |
|
4560 |
||
4561 |
generalPurposBitFlag:something |
|
4562 |
generalPurposBitFlag := something. |
|
4563 |
! |
|
4564 |
||
4565 |
internalFileAttributes |
|
4566 |
^ internalFileAttributes |
|
4567 |
! |
|
4568 |
||
4569 |
internalFileAttributes:something |
|
4570 |
internalFileAttributes := something. |
|
4571 |
! |
|
4572 |
||
4573 |
lastModFileDate |
|
4574 |
^ lastModFileDate |
|
4575 |
! |
|
4576 |
||
4577 |
lastModFileDate:something |
|
4578 |
lastModFileDate := something. |
|
4579 |
! |
|
4580 |
||
4581 |
lastModFileTime |
|
4582 |
^ lastModFileTime |
|
4583 |
! |
|
4584 |
||
4585 |
lastModFileTime:something |
|
4586 |
lastModFileTime := something. |
|
622 | 4587 |
! |
4588 |
||
4589 |
next |
|
4590 |
"return the value of the instance variable 'next' (automatically generated)" |
|
4591 |
||
4592 |
^ next |
|
4593 |
||
4594 |
"Created: / 29.3.1998 / 18:29:42 / cg" |
|
4595 |
! |
|
4596 |
||
4597 |
next:something |
|
4598 |
"set the value of the instance variable 'next' (automatically generated)" |
|
4599 |
||
4600 |
next := something. |
|
4601 |
||
4602 |
"Created: / 29.3.1998 / 18:29:42 / cg" |
|
4603 |
! |
|
4604 |
||
1979 | 4605 |
relativeLocalHeaderOffset |
4606 |
^ relativeLocalHeaderOffset |
|
4607 |
! |
|
4608 |
||
4609 |
relativeLocalHeaderOffset:something |
|
4610 |
relativeLocalHeaderOffset := something. |
|
4611 |
! |
|
4612 |
||
4613 |
uncompressedSize |
|
4614 |
^ uncompressedSize |
|
4615 |
! |
|
4616 |
||
4617 |
uncompressedSize:something |
|
4618 |
uncompressedSize := something. |
|
4619 |
! |
|
4620 |
||
4621 |
versionMadeBy |
|
4622 |
^ versionMadeBy |
|
4623 |
! |
|
4624 |
||
4625 |
versionMadeBy:something |
|
4626 |
versionMadeBy := something. |
|
4627 |
! |
|
4628 |
||
4629 |
versionNeedToExtract |
|
4630 |
^ versionNeedToExtract |
|
622 | 4631 |
! |
4632 |
||
1979 | 4633 |
versionNeedToExtract:something |
4634 |
versionNeedToExtract := something. |
|
4635 |
! ! |
|
4636 |
||
4637 |
!ZipArchive::ZipMember methodsFor:'initialize'! |
|
4638 |
||
4639 |
default |
|
4640 |
versionMadeBy := 20. |
|
4641 |
versionNeedToExtract := 20. |
|
4642 |
generalPurposBitFlag := 0. |
|
4643 |
compressionMethod := 0. |
|
4644 |
lastModFileTime := 0. |
|
4645 |
lastModFileDate := 0. |
|
4646 |
crc32 := 0. |
|
4647 |
compressedSize := 0. |
|
4648 |
uncompressedSize := 0. |
|
4649 |
fileNameLength := 0. |
|
4650 |
extraFieldLength := 0. |
|
4651 |
fileCommentLength := 0. |
|
4652 |
diskNumberStart := 0. |
|
4653 |
internalFileAttributes := 0. |
|
4654 |
externalFileAttributes := 0. |
|
4655 |
relativeLocalHeaderOffset := 0. |
|
4656 |
fileName := nil. |
|
4657 |
extraField := nil. |
|
4658 |
fileComment := nil. |
|
4659 |
dataStart := 0. |
|
4660 |
data := nil. |
|
622 | 4661 |
! ! |
4662 |
||
4663 |
!ZipArchive::ZipMember methodsFor:'printing & storing'! |
|
4664 |
||
4665 |
displayString |
|
1979 | 4666 |
^ 'ZipMember(' , (fileName ? '*nil*') , ')' |
622 | 4667 |
|
4668 |
"Created: / 29.3.1998 / 20:10:07 / cg" |
|
634 | 4669 |
"Modified: / 2.4.1998 / 15:10:08 / cg" |
622 | 4670 |
! ! |
4671 |
||
4672 |
!ZipArchive::ZipMember methodsFor:'queries'! |
|
4673 |
||
4674 |
fileStart |
|
1979 | 4675 |
^ self dataStart |
938
4544b3c105fe
fixed directory reading (care for comment and extra-header bytes)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
4676 |
"/ ^ relative_offset_local_header + ZipArchive LREC_SIZE + 4 + name size |
622 | 4677 |
|
4678 |
"Created: / 29.3.1998 / 19:10:57 / cg" |
|
4679 |
! ! |
|
4680 |
||
1982
dca43cec8a2b
add finalize for close by garbage collector extend interface for
ab
parents:
1981
diff
changeset
|
4681 |
!ZipArchive class methodsFor:'documentation'! |
dca43cec8a2b
add finalize for close by garbage collector extend interface for
ab
parents:
1981
diff
changeset
|
4682 |
|
dca43cec8a2b
add finalize for close by garbage collector extend interface for
ab
parents:
1981
diff
changeset
|
4683 |
version |
2161
a737bcc07579
#addDirectory: should not be used
Stefan Vogel <sv@exept.de>
parents:
2104
diff
changeset
|
4684 |
^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.74 2009-06-10 12:53:07 stefan Exp $' |
1982
dca43cec8a2b
add finalize for close by garbage collector extend interface for
ab
parents:
1981
diff
changeset
|
4685 |
! ! |
1129
8e0da7fb22fb
Use #raiseErrorString: instead of #raiseWith:
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
4686 |
|
622 | 4687 |
ZipArchive initialize! |