Packmatic.Field.Local.FileHeader (Packmatic v1.1.2) 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
Size | Content |
---|---|
4 bytes | Signature |
2 bytes | Version needed to extract |
2 bytes | General Purpose Flag |
2 bytes | Compression Method (0 = No Compression; 8 = Deflated) |
2 bytes | Modification Time (DOS Format) |
2 bytes | Modification Date (DOS Format) |
4 bytes | Checksum (CRC-32; 0 since Data Descriptor is used) |
4 bytes | Compressed Size (Bytes; 0 since Data Descriptor is used) |
4 bytes | Original Size (Bytes; 0 since Data Descriptor is used) |
2 bytes | File Path Length (Bytes) |
2 bytes | Extra Fields Length (Bytes) |
Variable | File Path |
Variable | Extra Fields |
Notes
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.
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.
The following Extra Field is emitted:
- Extended Timestamp, see
Packmatic.Field.Shared.ExtendedTimestamp
- Extended Timestamp, see
Link to this section Summary
Link to this section Types
Specs
t() :: %Packmatic.Field.Local.FileHeader{ path: Path.t(), timestamp: DateTime.t() }