Packmatic v1.0.0 Packmatic.Field.Central.FileHeader View Source

Represents the Central Directory File Header, which is part of the Central Directory that is emitted after all successfully encoded files have been incorporated into the Zip stream.

Structure

Central Directory File Header

SizeContent
4 bytesSignature
1 byteVersion made by - Zip Specification Version
1 byteVersion made by - Environment
2 bytesVersion needed to extract
2 bytesGeneral Purpose Flag
2 bytesCompression Method (0 = No Compression; 8 = Deflated)
2 bytesModification Time (DOS Format)
2 bytesModification Date (DOS Format)
4 bytesChecksum (CRC-32)
4 bytesCompressed Size (Placeholder; value set in Zip64 Extended Information Extra Field)
4 bytesOriginal Size (Placeholder; value set in Zip64 Extended Information Extra Field)
2 bytesFile Path Length (Bytes)
2 bytesExtra Fields Length (Bytes)
2 bytesFile Comment Length (Bytes)
2 bytesStarting Disk Number for File
2 bytesInternal Attrbutes
4 bytesExternal Attrbutes
4 bytesOffset of Local File Header
VariableFile Path
VariableExtra Fields
VariableFile Comment

Notes

  1. The General Purpose Flag has the following bits set.

    • Bit 3: Indicating a Streaming Archive; Data Descriptor is used, and the Local File Header has no Size or CRC information.
    • Bit 11: Language encoding flag, indicating that the Filename and Comment are both already in UTF-8. As per APPNOTE, the presence of this flag obviates the need to emit a separate Info-ZIP Unicode Path Extra Field.
  2. The Compressed Size and Original Size fields are both set to 0xFF 0xFF 0xFF 0xFF, in order to force the real sizes, set in the Zip64 Extended Information Extra Field (provided by Packmatic.Field.Shared.ExtendedInformation) to be used.

  3. The following Extra Fields are emitted:

  4. File comments are not emitted by Packmatic.

Link to this section Summary

Link to this section Types

Link to this type

t()

View Source
t() :: %Packmatic.Field.Central.FileHeader{
  checksum: term(),
  offset: non_neg_integer(),
  path: Path.t(),
  size: non_neg_integer(),
  size_compressed: non_neg_integer(),
  timestamp: DateTime.t()
}