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

Represents the Local File Header, which is emitted before the content of each file is incorporated into the Zip stream.

Structure

Local File Header

SizeContent
4 bytesSignature
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; 0 since Data Descriptor is used)
4 bytesCompressed Size (Bytes; 0 since Data Descriptor is used)
4 bytesOriginal Size (Bytes; 0 since Data Descriptor is used)
2 bytesFile Path Length (Bytes)
2 bytesExtra Fields Length (Bytes)
VariableFile Path
VariableExtra Fields

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 Checksum, Compressed Size and Original Size fields are set to 0, since when the Local File Header is written, no further data has been read and so this information is not available. When the file has been read fully, a Data Descriptor will be written, which contains relevant information.

  3. The following Extra Field is emitted:

Link to this section Summary

Link to this section Types

Link to this type

t()

View Source
t() :: %Packmatic.Field.Local.FileHeader{
  path: Path.t(),
  timestamp: DateTime.t()
}