Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 1 | \section{\module{zipfile} --- |
| 2 | Work with ZIP archives} |
| 3 | |
Fred Drake | 1675375 | 2000-09-18 16:21:11 +0000 | [diff] [blame] | 4 | \declaremodule{standard}{zipfile} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 5 | \modulesynopsis{Read and write ZIP-format archive files.} |
| 6 | \moduleauthor{James C. Ahlstrom}{jim@interet.com} |
| 7 | \sectionauthor{James C. Ahlstrom}{jim@interet.com} |
| 8 | % LaTeX markup by Fred L. Drake, Jr. <fdrake@acm.org> |
| 9 | |
Fred Drake | 6300bd4 | 2000-09-07 14:01:40 +0000 | [diff] [blame] | 10 | \versionadded{1.6} |
| 11 | |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 12 | The ZIP file format is a common archive and compression standard. |
| 13 | This module provides tools to create, read, write, append, and list a |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 14 | ZIP file. Any advanced use of this module will require an |
| 15 | understanding of the format, as defined in |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 16 | \citetitle[http://www.pkware.com/business_and_developers/developer/appnote/] |
| 17 | {PKZIP Application Note}. |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 18 | |
| 19 | This module does not currently handle ZIP files which have appended |
Thomas Wouters | cf297e4 | 2007-02-23 15:07:44 +0000 | [diff] [blame] | 20 | comments, or multi-disk ZIP files. It can handle ZIP files that use |
| 21 | the ZIP64 extensions (that is ZIP files that are more than 4 GByte in |
| 22 | size). It supports decryption of encrypted files in ZIP archives, but |
| 23 | it cannot currently create an encrypted file. |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 24 | |
| 25 | The available attributes of this module are: |
| 26 | |
| 27 | \begin{excdesc}{error} |
| 28 | The error raised for bad ZIP files. |
| 29 | \end{excdesc} |
| 30 | |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 31 | \begin{excdesc}{LargeZipFile} |
| 32 | The error raised when a ZIP file would require ZIP64 functionality but that |
| 33 | has not been enabled. |
| 34 | \end{excdesc} |
| 35 | |
Fred Drake | 96d7a70 | 2001-05-11 01:08:13 +0000 | [diff] [blame] | 36 | \begin{classdesc*}{ZipFile} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 37 | The class for reading and writing ZIP files. See |
| 38 | ``\citetitle{ZipFile Objects}'' (section \ref{zipfile-objects}) for |
| 39 | constructor details. |
Fred Drake | 886f113 | 2001-05-11 15:49:19 +0000 | [diff] [blame] | 40 | \end{classdesc*} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 41 | |
Fred Drake | 96d7a70 | 2001-05-11 01:08:13 +0000 | [diff] [blame] | 42 | \begin{classdesc*}{PyZipFile} |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 43 | Class for creating ZIP archives containing Python libraries. |
Fred Drake | 886f113 | 2001-05-11 15:49:19 +0000 | [diff] [blame] | 44 | \end{classdesc*} |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 45 | |
| 46 | \begin{classdesc}{ZipInfo}{\optional{filename\optional{, date_time}}} |
Raymond Hettinger | 6880431 | 2005-01-01 00:28:46 +0000 | [diff] [blame] | 47 | Class used to represent information about a member of an archive. |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 48 | Instances of this class are returned by the \method{getinfo()} and |
Fred Drake | e35360f | 2000-10-03 15:16:31 +0000 | [diff] [blame] | 49 | \method{infolist()} methods of \class{ZipFile} objects. Most users |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 50 | of the \module{zipfile} module will not need to create these, but |
| 51 | only use those created by this module. |
| 52 | \var{filename} should be the full name of the archive member, and |
| 53 | \var{date_time} should be a tuple containing six fields which |
| 54 | describe the time of the last modification to the file; the fields |
| 55 | are described in section \ref{zipinfo-objects}, ``ZipInfo Objects.'' |
| 56 | \end{classdesc} |
| 57 | |
Fred Drake | 5d63a39 | 2000-10-06 15:29:56 +0000 | [diff] [blame] | 58 | \begin{funcdesc}{is_zipfile}{filename} |
Neal Norwitz | 6b35370 | 2002-04-09 18:15:00 +0000 | [diff] [blame] | 59 | Returns \code{True} if \var{filename} is a valid ZIP file based on its magic |
| 60 | number, otherwise returns \code{False}. This module does not currently |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 61 | handle ZIP files which have appended comments. |
| 62 | \end{funcdesc} |
| 63 | |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 64 | \begin{datadesc}{ZIP_STORED} |
Fred Drake | 5d63a39 | 2000-10-06 15:29:56 +0000 | [diff] [blame] | 65 | The numeric constant for an uncompressed archive member. |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 66 | \end{datadesc} |
| 67 | |
| 68 | \begin{datadesc}{ZIP_DEFLATED} |
| 69 | The numeric constant for the usual ZIP compression method. This |
| 70 | requires the zlib module. No other compression methods are |
| 71 | currently supported. |
| 72 | \end{datadesc} |
| 73 | |
| 74 | |
| 75 | \begin{seealso} |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 76 | \seetitle[http://www.pkware.com/business_and_developers/developer/appnote/] |
| 77 | {PKZIP Application Note}{Documentation on the ZIP file format by |
| 78 | Phil Katz, the creator of the format and algorithms used.} |
Fred Drake | 58295de | 2000-09-30 00:11:45 +0000 | [diff] [blame] | 79 | |
| 80 | \seetitle[http://www.info-zip.org/pub/infozip/]{Info-ZIP Home Page}{ |
| 81 | Information about the Info-ZIP project's ZIP archive |
| 82 | programs and development libraries.} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 83 | \end{seealso} |
| 84 | |
| 85 | |
| 86 | \subsection{ZipFile Objects \label{zipfile-objects}} |
| 87 | |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 88 | \begin{classdesc}{ZipFile}{file\optional{, mode\optional{, compression\optional{, allowZip64}}}} |
Fred Drake | bda3a59 | 2001-05-09 19:57:37 +0000 | [diff] [blame] | 89 | Open a ZIP file, where \var{file} can be either a path to a file |
Fred Drake | 907e76b | 2001-07-06 20:30:11 +0000 | [diff] [blame] | 90 | (a string) or a file-like object. The \var{mode} parameter |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 91 | should be \code{'r'} to read an existing file, \code{'w'} to |
| 92 | truncate and write a new file, or \code{'a'} to append to an |
Fred Drake | bda3a59 | 2001-05-09 19:57:37 +0000 | [diff] [blame] | 93 | existing file. For \var{mode} is \code{'a'} and \var{file} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 94 | refers to an existing ZIP file, then additional files are added to |
Fred Drake | bda3a59 | 2001-05-09 19:57:37 +0000 | [diff] [blame] | 95 | it. If \var{file} does not refer to a ZIP file, then a new ZIP |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 96 | archive is appended to the file. This is meant for adding a ZIP |
| 97 | archive to another file, such as \file{python.exe}. Using |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 98 | |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 99 | \begin{verbatim} |
| 100 | cat myzip.zip >> python.exe |
| 101 | \end{verbatim} |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 102 | |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 103 | also works, and at least \program{WinZip} can read such files. |
Thomas Wouters | cf297e4 | 2007-02-23 15:07:44 +0000 | [diff] [blame] | 104 | If \var{mode} is \code{a} and the file does not exist at all, |
| 105 | it is created. |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 106 | \var{compression} is the ZIP compression method to use when writing |
| 107 | the archive, and should be \constant{ZIP_STORED} or |
| 108 | \constant{ZIP_DEFLATED}; unrecognized values will cause |
Fred Drake | e35360f | 2000-10-03 15:16:31 +0000 | [diff] [blame] | 109 | \exception{RuntimeError} to be raised. If \constant{ZIP_DEFLATED} |
Thomas Heller | 3d62f8c | 2002-01-14 08:37:39 +0000 | [diff] [blame] | 110 | is specified but the \refmodule{zlib} module is not available, |
Fred Drake | e35360f | 2000-10-03 15:16:31 +0000 | [diff] [blame] | 111 | \exception{RuntimeError} is also raised. The default is |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 112 | \constant{ZIP_STORED}. |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 113 | If \var{allowZip64} is \code{True} zipfile will create ZIP files that use |
| 114 | the ZIP64 extensions when the zipfile is larger than 2 GB. If it is |
| 115 | false (the default) \module{zipfile} will raise an exception when the |
| 116 | ZIP file would require ZIP64 extensions. ZIP64 extensions are disabled by |
| 117 | default because the default \program{zip} and \program{unzip} commands on |
| 118 | \UNIX{} (the InfoZIP utilities) don't support these extensions. |
Thomas Wouters | cf297e4 | 2007-02-23 15:07:44 +0000 | [diff] [blame] | 119 | |
| 120 | \versionchanged[If the file does not exist, it is created if the |
| 121 | mode is 'a']{2.6} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 122 | \end{classdesc} |
| 123 | |
Fred Drake | e35360f | 2000-10-03 15:16:31 +0000 | [diff] [blame] | 124 | \begin{methoddesc}{close}{} |
| 125 | Close the archive file. You must call \method{close()} before |
| 126 | exiting your program or essential records will not be written. |
| 127 | \end{methoddesc} |
| 128 | |
| 129 | \begin{methoddesc}{getinfo}{name} |
| 130 | Return a \class{ZipInfo} object with information about the archive |
| 131 | member \var{name}. |
| 132 | \end{methoddesc} |
| 133 | |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 134 | \begin{methoddesc}{infolist}{} |
| 135 | Return a list containing a \class{ZipInfo} object for each member of |
| 136 | the archive. The objects are in the same order as their entries in |
| 137 | the actual ZIP file on disk if an existing archive was opened. |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 138 | \end{methoddesc} |
| 139 | |
Fred Drake | 6fe9bac | 2000-10-11 18:56:00 +0000 | [diff] [blame] | 140 | \begin{methoddesc}{namelist}{} |
| 141 | Return a list of archive members by name. |
| 142 | \end{methoddesc} |
| 143 | |
Guido van Rossum | d8faa36 | 2007-04-27 19:54:29 +0000 | [diff] [blame] | 144 | \begin{methoddesc}{open}{name\optional{, mode\optional{, pwd}}} |
| 145 | Extract a member from the archive as a file-like object (ZipExtFile). |
| 146 | \var{name} is the name of the file in the archive. The \var{mode} |
| 147 | parameter, if included, must be one of the following: \code{'r'} (the |
| 148 | default), \code{'U'}, or \code{'rU'}. Choosing \code{'U'} or |
| 149 | \code{'rU'} will enable universal newline support in the read-only |
| 150 | object. \var{pwd} is the password used for encrypted files. |
| 151 | \begin{notice} |
| 152 | The file-like object is read-only and provides the following methods: |
| 153 | \method{read()}, \method{readline()}, \method{readlines()}, |
| 154 | \method{__iter__()}, \method{next()}. |
| 155 | \end{notice} |
| 156 | \begin{notice} |
| 157 | If the ZipFile was created by passing in a file-like object as the |
| 158 | first argument to the constructor, then the object returned by |
| 159 | \method{open()} shares the ZipFile's file pointer. Under these |
| 160 | circumstances, the object returned by \method{open()} should not |
| 161 | be used after any additional operations are performed on the |
| 162 | ZipFile object. If the ZipFile was created by passing in a string |
| 163 | (the filename) as the first argument to the constructor, then |
| 164 | \method{open()} will create a new file object that will be held |
| 165 | by the ZipExtFile, allowing it to operate independently of the |
| 166 | ZipFile. |
| 167 | \end{notice} |
| 168 | |
| 169 | \versionadded{2.6} |
| 170 | \end{methoddesc} |
| 171 | |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 172 | \begin{methoddesc}{printdir}{} |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 173 | Print a table of contents for the archive to \code{sys.stdout}. |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 174 | \end{methoddesc} |
| 175 | |
Thomas Wouters | cf297e4 | 2007-02-23 15:07:44 +0000 | [diff] [blame] | 176 | \begin{methoddesc}{setpassword}{pwd} |
| 177 | Set \var{pwd} as default password to extract encrypted files. |
| 178 | \versionadded{2.6} |
| 179 | \end{methoddesc} |
| 180 | |
| 181 | \begin{methoddesc}{read}{name\optional{, pwd}} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 182 | Return the bytes of the file in the archive. The archive must be |
Thomas Wouters | cf297e4 | 2007-02-23 15:07:44 +0000 | [diff] [blame] | 183 | open for read or append. \var{pwd} is the password used for encrypted |
| 184 | files and, if specified, it will override the default password set with |
| 185 | \method{setpassword()}. |
| 186 | |
| 187 | \versionchanged[\var{pwd} was added]{2.6} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 188 | \end{methoddesc} |
| 189 | |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 190 | \begin{methoddesc}{testzip}{} |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 191 | Read all the files in the archive and check their CRC's and file |
| 192 | headers. Return the name of the first bad file, or else return \code{None}. |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 193 | \end{methoddesc} |
| 194 | |
Fred Drake | e35360f | 2000-10-03 15:16:31 +0000 | [diff] [blame] | 195 | \begin{methoddesc}{write}{filename\optional{, arcname\optional{, |
| 196 | compress_type}}} |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 197 | Write the file named \var{filename} to the archive, giving it the |
Fred Drake | e35360f | 2000-10-03 15:16:31 +0000 | [diff] [blame] | 198 | archive name \var{arcname} (by default, this will be the same as |
Georg Brandl | 8f7c54e | 2006-02-20 08:40:38 +0000 | [diff] [blame] | 199 | \var{filename}, but without a drive letter and with leading path |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 200 | separators removed). If given, \var{compress_type} overrides the |
| 201 | value given for the \var{compression} parameter to the constructor |
| 202 | for the new entry. The archive must be open with mode \code{'w'} |
| 203 | or \code{'a'}. |
| 204 | |
| 205 | \note{There is no official file name encoding for ZIP files. |
| 206 | If you have unicode file names, please convert them to byte strings |
| 207 | in your desired encoding before passing them to \method{write()}. |
| 208 | WinZip interprets all file names as encoded in CP437, also known |
| 209 | as DOS Latin.} |
| 210 | |
Georg Brandl | 8f7c54e | 2006-02-20 08:40:38 +0000 | [diff] [blame] | 211 | \note{Archive names should be relative to the archive root, that is, |
| 212 | they should not start with a path separator.} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 213 | \end{methoddesc} |
| 214 | |
Just van Rossum | b083cb3 | 2002-12-12 12:23:32 +0000 | [diff] [blame] | 215 | \begin{methoddesc}{writestr}{zinfo_or_arcname, bytes} |
| 216 | Write the string \var{bytes} to the archive; \var{zinfo_or_arcname} |
| 217 | is either the file name it will be given in the archive, or a |
| 218 | \class{ZipInfo} instance. If it's an instance, at least the |
| 219 | filename, date, and time must be given. If it's a name, the date |
| 220 | and time is set to the current date and time. The archive must be |
| 221 | opened with mode \code{'w'} or \code{'a'}. |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 222 | \end{methoddesc} |
| 223 | |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 224 | |
| 225 | The following data attribute is also available: |
| 226 | |
| 227 | \begin{memberdesc}{debug} |
| 228 | The level of debug output to use. This may be set from \code{0} |
| 229 | (the default, no output) to \code{3} (the most output). Debugging |
| 230 | information is written to \code{sys.stdout}. |
| 231 | \end{memberdesc} |
| 232 | |
| 233 | |
| 234 | \subsection{PyZipFile Objects \label{pyzipfile-objects}} |
| 235 | |
| 236 | The \class{PyZipFile} constructor takes the same parameters as the |
| 237 | \class{ZipFile} constructor. Instances have one method in addition to |
| 238 | those of \class{ZipFile} objects. |
| 239 | |
| 240 | \begin{methoddesc}[PyZipFile]{writepy}{pathname\optional{, basename}} |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 241 | Search for files \file{*.py} and add the corresponding file to the |
| 242 | archive. The corresponding file is a \file{*.pyo} file if |
| 243 | available, else a \file{*.pyc} file, compiling if necessary. If the |
| 244 | pathname is a file, the filename must end with \file{.py}, and just |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 245 | the (corresponding \file{*.py[co]}) file is added at the top level |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 246 | (no path information). If it is a directory, and the directory is |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 247 | not a package directory, then all the files \file{*.py[co]} are |
Fred Drake | 3c9f936 | 2000-03-31 17:51:10 +0000 | [diff] [blame] | 248 | added at the top level. If the directory is a package directory, |
| 249 | then all \file{*.py[oc]} are added under the package name as a file |
| 250 | path, and if any subdirectories are package directories, all of |
| 251 | these are added recursively. \var{basename} is intended for |
| 252 | internal use only. The \method{writepy()} method makes archives |
| 253 | with file names like this: |
| 254 | |
| 255 | \begin{verbatim} |
| 256 | string.pyc # Top level name |
| 257 | test/__init__.pyc # Package directory |
| 258 | test/testall.pyc # Module test.testall |
| 259 | test/bogus/__init__.pyc # Subpackage directory |
| 260 | test/bogus/myfile.pyc # Submodule test.bogus.myfile |
| 261 | \end{verbatim} |
| 262 | \end{methoddesc} |
| 263 | |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 264 | |
| 265 | \subsection{ZipInfo Objects \label{zipinfo-objects}} |
| 266 | |
| 267 | Instances of the \class{ZipInfo} class are returned by the |
Fred Drake | e35360f | 2000-10-03 15:16:31 +0000 | [diff] [blame] | 268 | \method{getinfo()} and \method{infolist()} methods of |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 269 | \class{ZipFile} objects. Each object stores information about a |
| 270 | single member of the ZIP archive. |
| 271 | |
| 272 | Instances have the following attributes: |
| 273 | |
| 274 | \begin{memberdesc}[ZipInfo]{filename} |
| 275 | Name of the file in the archive. |
| 276 | \end{memberdesc} |
| 277 | |
| 278 | \begin{memberdesc}[ZipInfo]{date_time} |
Raymond Hettinger | 999b57c | 2003-08-25 04:28:05 +0000 | [diff] [blame] | 279 | The time and date of the last modification to the archive |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 280 | member. This is a tuple of six values: |
| 281 | |
| 282 | \begin{tableii}{c|l}{code}{Index}{Value} |
| 283 | \lineii{0}{Year} |
| 284 | \lineii{1}{Month (one-based)} |
| 285 | \lineii{2}{Day of month (one-based)} |
| 286 | \lineii{3}{Hours (zero-based)} |
| 287 | \lineii{4}{Minutes (zero-based)} |
| 288 | \lineii{5}{Seconds (zero-based)} |
| 289 | \end{tableii} |
| 290 | \end{memberdesc} |
| 291 | |
| 292 | \begin{memberdesc}[ZipInfo]{compress_type} |
| 293 | Type of compression for the archive member. |
| 294 | \end{memberdesc} |
| 295 | |
| 296 | \begin{memberdesc}[ZipInfo]{comment} |
| 297 | Comment for the individual archive member. |
| 298 | \end{memberdesc} |
| 299 | |
| 300 | \begin{memberdesc}[ZipInfo]{extra} |
| 301 | Expansion field data. The |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 302 | \citetitle[http://www.pkware.com/business_and_developers/developer/appnote/] |
| 303 | {PKZIP Application Note} contains some comments on the internal |
| 304 | structure of the data contained in this string. |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 305 | \end{memberdesc} |
| 306 | |
| 307 | \begin{memberdesc}[ZipInfo]{create_system} |
| 308 | System which created ZIP archive. |
| 309 | \end{memberdesc} |
| 310 | |
| 311 | \begin{memberdesc}[ZipInfo]{create_version} |
| 312 | PKZIP version which created ZIP archive. |
| 313 | \end{memberdesc} |
| 314 | |
| 315 | \begin{memberdesc}[ZipInfo]{extract_version} |
| 316 | PKZIP version needed to extract archive. |
| 317 | \end{memberdesc} |
| 318 | |
| 319 | \begin{memberdesc}[ZipInfo]{reserved} |
| 320 | Must be zero. |
| 321 | \end{memberdesc} |
| 322 | |
| 323 | \begin{memberdesc}[ZipInfo]{flag_bits} |
| 324 | ZIP flag bits. |
| 325 | \end{memberdesc} |
| 326 | |
| 327 | \begin{memberdesc}[ZipInfo]{volume} |
| 328 | Volume number of file header. |
| 329 | \end{memberdesc} |
| 330 | |
| 331 | \begin{memberdesc}[ZipInfo]{internal_attr} |
| 332 | Internal attributes. |
| 333 | \end{memberdesc} |
| 334 | |
| 335 | \begin{memberdesc}[ZipInfo]{external_attr} |
| 336 | External file attributes. |
| 337 | \end{memberdesc} |
| 338 | |
| 339 | \begin{memberdesc}[ZipInfo]{header_offset} |
| 340 | Byte offset to the file header. |
| 341 | \end{memberdesc} |
| 342 | |
Fred Drake | 4278024 | 2000-10-02 20:56:30 +0000 | [diff] [blame] | 343 | \begin{memberdesc}[ZipInfo]{CRC} |
| 344 | CRC-32 of the uncompressed file. |
| 345 | \end{memberdesc} |
| 346 | |
| 347 | \begin{memberdesc}[ZipInfo]{compress_size} |
| 348 | Size of the compressed data. |
| 349 | \end{memberdesc} |
| 350 | |
| 351 | \begin{memberdesc}[ZipInfo]{file_size} |
| 352 | Size of the uncompressed file. |
| 353 | \end{memberdesc} |