mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
archive/zip: new package for reading ZIP files
R=rsc CC=golang-dev https://golang.org/cl/2125042
This commit is contained in:
parent
fdb9e68c4e
commit
a00b98ec3f
10 changed files with 504 additions and 0 deletions
33
src/pkg/archive/zip/struct.go
Normal file
33
src/pkg/archive/zip/struct.go
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package zip
|
||||
|
||||
const (
|
||||
fileHeaderSignature = 0x04034b50
|
||||
directoryHeaderSignature = 0x02014b50
|
||||
directoryEndSignature = 0x06054b50
|
||||
)
|
||||
|
||||
type FileHeader struct {
|
||||
Name string
|
||||
CreatorVersion uint16
|
||||
ReaderVersion uint16
|
||||
Flags uint16
|
||||
Method uint16
|
||||
ModifiedTime uint16
|
||||
ModifiedDate uint16
|
||||
CRC32 uint32
|
||||
CompressedSize uint32
|
||||
UncompressedSize uint32
|
||||
Extra []byte
|
||||
Comment string
|
||||
}
|
||||
|
||||
type directoryEnd struct {
|
||||
diskNbr uint16 // unused
|
||||
dirDiskNbr uint16 // unused
|
||||
dirRecordsThisDisk uint16 // unused
|
||||
directoryRecords uint16
|
||||
directorySize uint32
|
||||
directoryOffset uint32 // relative to file
|
||||
commentLen uint16
|
||||
comment string
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue