zip

package
v0.0.0-...-e758773 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2011 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package zip provides support for reading ZIP archives.

See: http://www.pkware.com/documents/casestudies/APPNOTE.TXT

This package does not support ZIP64 or disk spanning.

Index

Constants

This section is empty.

Variables

View Source
var (
	FormatError       = os.NewError("not a valid zip file")
	UnsupportedMethod = os.NewError("unsupported compression algorithm")
	ChecksumError     = os.NewError("checksum error")
)

Functions

This section is empty.

Types

type File

type File struct {
	FileHeader
	// contains filtered or unexported fields
}

func (*File) Open

func (f *File) Open() (rc io.ReadCloser, err os.Error)

Open returns a ReadCloser that provides access to the File's contents.

type FileHeader

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 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 ReaderCloser.

func (*ReadCloser) Close

func (rc *ReadCloser) Close() os.Error

Close closes the Zip file, rendering it unusable for I/O.

type Reader

type Reader struct {
	File    []*File
	Comment string
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.ReaderAt, size int64) (*Reader, os.Error)

NewReader returns a new Reader reading from r, which is assumed to have the given size in bytes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL