Packmatic.Field.Central.FileHeader (Packmatic v1.2.0) 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
Size | Content |
---|---|
4 bytes | Signature |
1 byte | Version made by - Zip Specification Version |
1 byte | Version made by - Environment |
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) |
4 bytes | Compressed Size (Placeholder; value set in Zip64 Extended Information Extra Field) |
4 bytes | Original Size (Placeholder; value set in Zip64 Extended Information Extra Field) |
2 bytes | File Path Length (Bytes) |
2 bytes | Extra Fields Length (Bytes) |
2 bytes | File Comment Length (Bytes) |
2 bytes | Starting Disk Number for File |
2 bytes | Internal Attrbutes |
4 bytes | External Attrbutes |
4 bytes | Offset of Local File Header |
Variable | File Path |
Variable | Extra Fields |
Variable | File Comment |
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 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 byPackmatic.Field.Shared.ExtendedInformation
) to be used.The following Extra Fields are emitted:
- Extended Timestamp, see
Packmatic.Field.Shared.ExtendedTimestamp
- Zip64 Extended Information, see
Packmatic.Field.Shared.ExtendedInformation
- Extended Timestamp, see
File comments are not emitted by Packmatic.
Link to this section Summary
Link to this section Types
Specs
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() }