| 1 |
README.DOS |
| 2 |
|
| 3 |
Some notes about the supplied MSDOS executables and their compilers: |
| 4 |
|
| 5 |
A) The 32-bit DOS executables "zip.exe" and the auxilary utilities |
| 6 |
"zipnote.exe", "zipsplit.exe", "zipcloak.exe" (crypt-enabled distribution |
| 7 |
only) were compiled with DJGPP v 2.03, using gcc 2.95.3 as compiler. |
| 8 |
They require a DPMI server to run, e.g.: a DOS command prompt window |
| 9 |
under WINDOWS 3.x or Windows 9x. To use this program under plain DOS, |
| 10 |
you should install the free (GPL'ed) DPMI server CWSDPMI.EXE. Look |
| 11 |
for "csdpmi5b.zip" under "simtelnet/gnu/djgpp/v2misc/" on the SimTelNet |
| 12 |
home site "ftp.cdrom.com" or any mirror site of the SimtelNet archive. |
| 13 |
|
| 14 |
We have decided to provide 32-bit rather than 16-bit executables of |
| 15 |
the auxilary tools for the following reasons: |
| 16 |
- Nowadays, it has become quite unlikely to find PC computers "in action" |
| 17 |
that do not at least have an i386 CPU. |
| 18 |
- the 32-bit versions do not impose additional archive handling limits |
| 19 |
beyond those defined by the Zip archive format |
| 20 |
- the 32-bit DJGPP executables can handle long filenames on systems running |
| 21 |
Windows 95/98/Me and Windows 2K/XP. |
| 22 |
|
| 23 |
B) There are two 16-bit MSDOS executables provided in zcr2?x.zip: |
| 24 |
zip16.exe regular Zip program, requires ca. 455 KBytes of contiguous |
| 25 |
free DOS memory or more. |
| 26 |
zip16-sm.exe a variant that was compiled with the SMALL_MEM option |
| 27 |
for minimal memory consumption; requires at minimum |
| 28 |
322 KBytes of contiguous free DOS memory. |
| 29 |
|
| 30 |
The SMALL_MEM variant requires much less space for the compression |
| 31 |
buffers, but at the cost of some compression efficiency. |
| 32 |
Therefore, we recommend to use the "SMALL_MEM" 16-bit "zip16-sm.exe" only |
| 33 |
in case of "out of memory" problems (DOS memory is low and/or very large |
| 34 |
number of archive entries), when the 32-bit program cannot be used for |
| 35 |
some reason (286 or older; no DPMI server; ...). |
| 36 |
|
| 37 |
C) Hard limits of the Zip archive format: |
| 38 |
Number of entries in Zip archive: 64 k (2^16 - 1 entries) |
| 39 |
Compressed size of archive entry: 4 GByte (2^32 - 1 Bytes) |
| 40 |
Uncompressed size of entry: 4 GByte (2^32 - 1 Bytes) |
| 41 |
Size of single-volume Zip archive: 4 GByte (2^32 - 1 Bytes) |
| 42 |
Per-volume size of multi-volume archives: 4 GByte (2^32 - 1 Bytes) |
| 43 |
Number of parts for multi-volume archives: 64 k (1^16 - 1 parts) |
| 44 |
Total size of multi-volume archive: 256 TByte (4G * 64k) |
| 45 |
|
| 46 |
The number of archive entries and of multivolume parts are limited by |
| 47 |
the structure of the "end-of-central-directory" record, where the these |
| 48 |
numbers are stored in 2-Byte fields. |
| 49 |
Some Zip and/or UnZip implementations (for example Info-ZIP's) allow |
| 50 |
handling of archives with more than 64k entries. (The information |
| 51 |
from "number of entries" field in the "end-of-central-directory" record |
| 52 |
is not really neccessary to retrieve the contents of a Zip archive; |
| 53 |
it should rather be used for consistency checks.) |
| 54 |
|
| 55 |
Length of an archive entry name: 64 kByte (2^16 - 1) |
| 56 |
Length of archive member comment: 64 kByte (2^16 - 1) |
| 57 |
Total length of "extra field": 64 kByte (2^16 - 1) |
| 58 |
Length of a single e.f. block: 64 kByte (2^16 - 1) |
| 59 |
Length of archive comment: 64 KByte (2^16 - 1) |
| 60 |
|
| 61 |
Additional limitation claimed by PKWARE: |
| 62 |
Size of local-header structure (fixed fields of 30 Bytes + filename |
| 63 |
local extra field): < 64 kByte |
| 64 |
Size of central-directory structure (46 Bytes + filename + |
| 65 |
central extra field + member comment): < 64 kByte |
| 66 |
|
| 67 |
D) Implementation limits of the Zip executables: |
| 68 |
|
| 69 |
1. Size limits caused by file I/O and compression handling: |
| 70 |
Size of Zip archive: 2 GByte (2^31 - 1 Bytes) |
| 71 |
Compressed size of archive entry: 2 GByte (2^31 - 1 Bytes) |
| 72 |
Uncompressed size of entry: 2 GByte (2^31 - 1 Bytes), |
| 73 |
(could/should be 4 GBytes...) |
| 74 |
Multi-volume archive creation is not supported. |
| 75 |
|
| 76 |
2. Limits caused by handling of archive contents lists |
| 77 |
|
| 78 |
2.1. Number of archive entries (freshen, update, delete) |
| 79 |
a) 16-bit executable: 64k (2^16 -1) or 32k (2^15 - 1), |
| 80 |
(unsigned vs. signed type of size_t) |
| 81 |
a1) 16-bit executable: <16k ((2^16)/4) |
| 82 |
(The smaller limit a1) results from the array size limit of |
| 83 |
the "qsort()" function.) |
| 84 |
32-bit executables <1G ((2^32)/4) |
| 85 |
(usual system limit of the "qsort()" function on 32-bit systems) |
| 86 |
|
| 87 |
b) stack space needed by qsort to sort list of archive entries |
| 88 |
|
| 89 |
NOTE: In the current executables, overflows of limits a) and b) are NOT |
| 90 |
checked! |
| 91 |
|
| 92 |
c) amount of free memory to hold "central directory information" of |
| 93 |
all archive entries; one entry needs: |
| 94 |
96 bytes (32-bit) resp. 80 bytes (16-bit) |
| 95 |
+ 3 * length of entry name |
| 96 |
+ length of zip entry comment (when present) |
| 97 |
+ length of extra field(s) (when present, e.g.: UT needs 9 bytes) |
| 98 |
+ some bytes for book-keeping of memory allocation |
| 99 |
|
| 100 |
Conclusion: |
| 101 |
For systems with limited memory space (MSDOS, small AMIGAs, other |
| 102 |
environments without virtual memory), the number of archive entries |
| 103 |
is most often limited by condition c). |
| 104 |
For example, with approx. 100 kBytes of free memory after loading and |
| 105 |
initializing the program, a 16-bit DOS Zip cannot process more than 600 |
| 106 |
to 1000 (+) archive entries. (For the 16-bit Windows DLL or the 16-bit |
| 107 |
OS/2 port, limit c) is less important because Windows or OS/2 executables |
| 108 |
are not restricted to the 1024k area of real mode memory. These 16-bit |
| 109 |
ports are limited by conditions a1) and b), say: at maximum approx. |
| 110 |
16000 entries!) |
| 111 |
|
| 112 |
|
| 113 |
2.2. Number of "new" entries (add operation) |
| 114 |
In addition to the restrictions above (2.1.), the following limits |
| 115 |
caused by the handling of the "new files" list apply: |
| 116 |
|
| 117 |
a) 16-bit executable: <16k ((2^64)/4) |
| 118 |
|
| 119 |
b) stack size required for "qsort" operation on "new entries" list. |
| 120 |
|
| 121 |
NOTE: In the current executables, the overflow checks for these limits |
| 122 |
are missing! |
| 123 |
|
| 124 |
c) amount of free memory to hold the directory info list for new entries; |
| 125 |
one entry needs: |
| 126 |
24 bytes (32-bit) resp. 22 bytes (16-bit) |
| 127 |
+ 3 * length of filename |
| 128 |
|
| 129 |
|
| 130 |
Please report any problems to: [email protected] |
| 131 |
|
| 132 |
Last updated: 07 July 2001 |