

Zip decompressor zip#
unpack( structEndArchive, recData))ĬommentSize = endrec #as claimed by the zip fileĬomment = data # found the magic number attempt to unpack and interpret

MaxCommentStart = max( filesize - ( 1 = 0: It is assumed that the "end of central directory" magic

Zip decompressor zip file#
The comment is the last item in the ZIP file and may be Search the end of the file for the "end of central directory"
Zip decompressor archive#
# Either this is not a ZIP file, or it is a ZIP file with an archive Return _EndRecData64( fpin, - sizeEndCentDir, endrec) # Try to read the "Zip64 end of central directory" structure # Append a blank comment and record start offsetĮndrec. # the signature is correct and there's no comment, unpack structureĮndrec = struct. # "end of central directory" structure should be the last item in the # Check to see if this is ZIP file with no archive comment (the

Record followed by a tenth item, the file seek offset of this record.""" The data is a list of the nine items in the ZIP "End of central dir" """Return data from the "End of Central Directory" record, or None.
Zip decompressor update#
# Update the original endrec using data from the ZIP64 recordĮndrec = dircount Sig, sz, create_version, read_version, disk_num, disk_dir, \ĭircount, dircount2, dirsize, diroffset = \ seek( offset - sizeEndCentDir64Locator - sizeEndCentDir64, 2) Raise BadZipFile( "zipfiles that span multiple disks are not supported")įpin. Raised when writing a zipfile, the zipfile requires ZIP64 extensionsĮrror = BadZipfile = BadZipFile # Pre-3.2 compatibility names "is_zipfile", "ZipInfo", "ZipFile", "PyZipFile", "LargeZipFile"] "ZIP_STORED", "ZIP_DEFLATED", "ZIP_BZIP2", "ZIP_LZMA", _all_ = [ "BadZipFile", "BadZipfile", "error", Import lzma # We may need its compression method Import bz2 # We may need its compression method Import zlib # We may need its compression method XXX references to utf-8 need further investigation. BadZipFile Class LargeZipFile Class _strip_extra Function _check_zipfile Function is_zipfile Function _EndRecData64 Function _EndRecData Function ZipInfo Class _init_ Function _repr_ Function FileHeader Function _encodeFilenameFlags Function _decodeExtra Function from_file Function is_dir Function _gen_crc Function _ZipDecrypter Function crc32 Function update_keys Function decrypter Function LZMACompressor Class _init_ Function _init Function compress Function flush Function LZMADecompressor Class _init_ Function decompress Function _check_compression Function _get_compressor Function _get_decompressor Function _SharedFile Class _init_ Function seek Function read Function close Function _Tellable Class _init_ Function write Function tell Function flush Function close Function ZipExtFile Class _init_ Function _repr_ Function readline Function peek Function readable Function read Function _update_crc Function read1 Function _read1 Function _read2 Function close Function seekable Function seek Function tell Function _ZipWriteFile Class _init_ Function _fileobj Function writable Function write Function close Function ZipFile Class _init_ Function _enter_ Function _exit_ Function _repr_ Function _RealGetContents Function namelist Function infolist Function printdir Function testzip Function getinfo Function setpassword Function comment Function comment Function read Function open Function _open_to_write Function extract Function extractall Function _sanitize_windows_name Function _extract_member Function _writecheck Function write Function writestr Function _del_ Function close Function _write_end_record Function _fpclose Function PyZipFile Class _init_ Function writepy Function _get_codename Function _compile Function MultiFile Class _init_ Function clear Function current_file_no Function current_file_size Function current_file_capacity Function open_next_file Function tell Function write Function flush Function close Function main Function addToZip Function
