Documentation ¶
Overview ¶
Package zip provides support for reading and writing ZIP archives.
See: http://www.pkware.com/documents/casestudies/APPNOTE.TXT
This package does not support ZIP64 or disk spanning.
Index ¶
Constants ¶
const ( Store uint16 = 0 Deflate uint16 = 8 )
Compression methods.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { FileHeader // contains filtered or unexported fields }
type FileHeader ¶
type FileHeader struct { Name string CreatorVersion uint16 ReaderVersion uint16 Flags uint16 Method uint16 ModifiedTime uint16 // MS-DOS time ModifiedDate uint16 // MS-DOS date CRC32 uint32 CompressedSize uint32 UncompressedSize uint32 Extra []byte Comment string }
func (*FileHeader) Mtime_ns ¶
func (h *FileHeader) Mtime_ns() int64
Mtime_ns returns the modified time in ns since epoch. The resolution is 2s.
type ReadCloser ¶
type ReadCloser struct { Reader // contains filtered or unexported fields }
func OpenReader ¶
func OpenReader(name string) (*ReadCloser, os.Error)
OpenReader will open the Zip file specified by name and return a ReadCloser.
func (*ReadCloser) Close ¶
func (rc *ReadCloser) Close() os.Error
Close closes the Zip file, rendering it unusable for I/O.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer implements a zip file writer.
func (*Writer) Close ¶
Close finishes writing the zip file by writing the central directory. It does not (and can not) close the underlying writer.
func (*Writer) Create ¶
Create adds a file to the zip file using the provided name. It returns a Writer to which the file contents should be written. The file's contents must be written to the io.Writer before the next call to Create, CreateHeader, or Close.
func (*Writer) CreateHeader ¶
CreateHeader adds a file to the zip file using the provided FileHeader for the file metadata. It returns a Writer to which the file contents should be written. The file's contents must be written to the io.Writer before the next call to Create, CreateHeader, or Close.