User Tools

Site Tools


torrentzip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
torrentzip [2022/01/31 14:17] gordonjtorrentzip [2022/11/20 11:07] (current) johnsanc
Line 28: Line 28:
 ^Type ^Attribute ^Value ^Description ^  ^Type ^Attribute ^Value ^Description ^ 
 |UInt32|Local file header signature|(0x04034b50)| | |UInt32|Local file header signature|(0x04034b50)| |
-|UInt16|Version needed to extract|20|File is compressed using Deflate compression| +|UInt16|Version needed to extract|20 or 45|20 = File is compressed using Deflate compression / 45 if this record contains zip64 information
-|UInt16|General purpose bit flag|2|Maximum compression option was used|+|UInt16|General purpose bit flag|2|Maximum compression option was used, bit 11 (0x800) is set for unicode filename|
 |UInt16|Compression method|8|The file is Deflated| |UInt16|Compression method|8|The file is Deflated|
 |UInt16|Last mod file time|48128|11:32 PM| |UInt16|Last mod file time|48128|11:32 PM|
Line 37: Line 37:
 |UInt32|Uncompressed size| |File Uncompressed Size| |UInt32|Uncompressed size| |File Uncompressed Size|
 |UInt16|Filename length| |Filename length| |UInt16|Filename length| |Filename length|
-|UInt16|Extra field length|0|No extra field information|+|UInt16|Extra field length| |Normally 0, Length of Extra field data if zip64 extra field information is included|
 |Byte[]|Filename (variable size)| |Byte array of filename| |Byte[]|Filename (variable size)| |Byte array of filename|
  
-|**ⓘ NOTE:** \\ The default values show are required to have consistent torrentzipped files. Default time/date of 11:32pm 12/24/1996 is the date of the first ever MAME release.|+<WRAP info>The default values show are required to have consistent torrentzipped files. Default time/date of 11:32pm 12/24/1996 is the date of the first ever MAME release.</WRAP>
  
 ==== File data x: ==== ==== File data x: ====
Line 51: Line 51:
 |UInt32|Central file header signature|(0x02014b50)| | |UInt32|Central file header signature|(0x02014b50)| |
 |UInt16|Version made by|0|MS_DOS and OS/2 (FAT/FAT32 file systems)| |UInt16|Version made by|0|MS_DOS and OS/2 (FAT/FAT32 file systems)|
-|UInt16|Version needed to extract|20|File is compressed using Deflate compression| +|UInt16|Version needed to extract|20 or 45|20 = File is compressed using Deflate compression / 45 if this record contains zip64 information
-|UInt16|General purpose bit flag|2|Maximum compression option was used|+|UInt16|General purpose bit flag|2|Maximum compression option was used, bit 11 (0x800) is set for unicode filename|
 |UInt16|Compression method|8|The file is Deflated| |UInt16|Compression method|8|The file is Deflated|
 |UInt16|Last mod file time|48128|11:32 PM| |UInt16|Last mod file time|48128|11:32 PM|
Line 60: Line 60:
 |UInt32|Uncompressed size| |File Uncompressed Size| |UInt32|Uncompressed size| |File Uncompressed Size|
 |UInt16|File name length| |Filename length| |UInt16|File name length| |Filename length|
-|UInt16|Extra field length|0|No extra field information|+|UInt16|Extra field length| |Normally 0, Length of Extra field data if zip64 extra field information is included|
 |UInt16|File comment length|0|No file comment| |UInt16|File comment length|0|No file comment|
 |UInt16|Disk number start|0|Multi disk storage not used so set to disk 0| |UInt16|Disk number start|0|Multi disk storage not used so set to disk 0|
Line 80: Line 80:
 |Byte[22]|.ZIP file comment|TORRENTZIPPED-XXXXXXXX| | |Byte[22]|.ZIP file comment|TORRENTZIPPED-XXXXXXXX| |
  
-|**ⓘ NOTE:** \\ See above 'General format of a torrentzipped .zip file with n files' for SOCD & EOCD |+<WRAP info>See above 'General format of a torrentzipped .zip file with n files' for SOCD & EOCD</WRAP>
  
  
Line 89: Line 89:
  
 This comment ensures that if any change is made to the files within the zip this checksum will no longer match the byte data in the central directory, and in this way we can check the validity of a torrentzip file. This comment ensures that if any change is made to the files within the zip this checksum will no longer match the byte data in the central directory, and in this way we can check the validity of a torrentzip file.
-===== File name Encoding ===== +===== Filename Encoding ===== 
-The filenames of the compressed files in a zip file is stored in the local header and the central directory as byte arrays, zip was original build on early IBM PC, and as such uses [[https://en.wikipedia.org/wiki/Code_page_437|code page 437]] to convert a string name to a byte array to store the filenames. With the arrival of unicode different methods where added to the official zip format to permit unicode filenames to be stored a zip file. So to store a filename in a trrntzip zip file you must first see if the filename can be stored using code page 437, if not then UTF8 encoding should be used in the byte arrays, this is then indicated by setting bit 11 of the General Purpose Bit Flags both in the local header and central directory.  +The filenames of the compressed files in a zip file are stored in the local header and the central directory as byte arrays. Zip was original build on early IBM PCs, and as such uses [[https://en.wikipedia.org/wiki/Code_page_437|code page 437]] to convert a string to a byte array to store the filenames. With the arrival of unicode multiple different methods where added to the official zip format to permit unicode filenames to be stored in a zip file. Trrntzip format uses the general purpose bit 11 method. So to store a filename in a trrntzip zip file you must first see if the filename can be stored using code page 437, if not then UTF8 encoding should be used in the byte arrays, this is then indicated by setting bit 11 of the General Purpose Bit Flags both in the local header and central directory.  
  
  
torrentzip.1643667439.txt.gz · Last modified: 2022/01/31 13:17 (external edit)