Documentation
¶
Overview ¶
Package zipx writes the ZIP archives lfm ships (EPUB, .docx, .pptx, .xlsx, download and shop ZIPs) the way the strictest readers want them: every entry carries its sizes in its header, no data descriptors, no extra fields, UTF-8 names flagged, one fixed timestamp, so the same input gives the same bytes. EPUB forbids an extra field on its mimetype entry; LibreOffice refuses stored entries followed by a data descriptor.
Index ¶
Constants ¶
const StampPrefix = "lfm-input:"
StampPrefix starts the zip comment carrying a file's input key; apps never show the comment.
Variables ¶
This section is empty.
Functions ¶
func Problems ¶
Problems lists where an archive breaks the rules this package writes by, reading every entry's local header through the central directory: a data descriptor, an extra field, a UTF-8 name without its flag, an EPUB mimetype entry that is compressed. Tests hold every archive lfm builds to it.
Types ¶
type Packed ¶
type Packed struct {
Data []byte // deflated
CRC uint32
Size uint64 // uncompressed
Compressed uint64
}
Packed is data compressed once, for entries many archives share, such as a font every document embeds.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer appends entries to one archive.
func (*Writer) Copy ¶
Copy writes an entry of another archive with this archive's header rules, keeping its compressed bytes.