aboutsummaryrefslogtreecommitdiff
path: root/struct.go
diff options
context:
space:
mode:
Diffstat (limited to 'struct.go')
-rw-r--r--struct.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/struct.go b/struct.go
index eef0b91..123f895 100644
--- a/struct.go
+++ b/struct.go
@@ -41,7 +41,7 @@ const (
fileHeaderLen = 26 // + filename + extra
directoryHeaderLen = 42 // + filename + extra + comment
directoryEndLen = 18 // + comment
- dataDescriptorLen = 16 // four uint32: descriptor signature, crc32, compressed size, size
+ dataDescriptorLen = 12 // four uint32: descriptor signature, crc32, compressed size, size
dataDescriptor64Len = 24 // two uint32: signature, crc32 | two uint64: compressed size, size
directory64LocLen = 20 //
directory64EndLen = 56 // + extra
@@ -135,6 +135,10 @@ type FileHeader struct {
UncompressedSize64 uint64
Extra []byte
ExternalAttrs uint32 // Meaning depends on CreatorVersion
+
+ DescriptorCRC32 uint32
+ DescriptorCompressedSize uint32
+ DescriptorUncompressedSize uint32
}
// FileInfo returns an fs.FileInfo for the FileHeader.
@@ -199,6 +203,8 @@ type directoryEnd struct {
DirectoryOffset uint64 // relative to file
CommentLen uint16
Comment string
+
+ HeaderOffset int64 // includes overall ZIP archive baseOffset
}
// timeZone returns a *time.Location based on the provided offset.