Home | History | Annotate | Download | only in pack

Lines Matching full:archive

22 The archive format is:
53 // need "pack op archive" at least.
60 var ar *Archive
63 ar = archive(os.Args[2], os.O_RDONLY, os.Args[3:])
66 ar = archive(os.Args[2], os.O_RDWR, os.Args[3:])
70 ar = archive(os.Args[2], os.O_RDWR|os.O_TRUNC, os.Args[3:])
74 ar = archive(os.Args[2], os.O_RDONLY, os.Args[3:])
77 ar = archive(os.Args[2], os.O_RDONLY, os.Args[3:])
85 log.Fatalf("file %q not in archive", ar.files[0])
101 // formerly canonical way to build a new archive
136 // An Archive represents an open archive file. It is always scanned sequentially
138 type Archive struct {
141 pad int // Padding bytes required at end of current archive file
142 matchAll bool // match all files in archive
145 // archive opens (and if necessary creates) the named archive.
146 func archive(name string, mode int, files []string) *Archive {
147 // If the file exists, it must be an archive. If it doesn't exist, or if
148 // we're doing the c command, indicated by O_TRUNC, truncate the archive.
158 return &Archive{
165 // create creates and initializes an archive that does not exist.
178 // existingArchive reports whether the file exists and is a valid archive.
179 // If it exists but is not an archive, existingArchive will exit.
199 log.Fatalf("%s is not an archive: bad header", fd.Name())
203 // An Entry is the internal representation of the per-file header information of one entry in the archive.
223 // readMetadata reads and parses the metadata for the next entry in the archive.
224 func (ar *Archive) readMetadata() *Entry {
232 log.Fatal("file is not an archive: bad entry")
237 log.Fatal("file is not an archive: bad name")
244 log.Fatal("file is not an archive: bad number in entry: ", err)
258 // scan scans the archive and executes the specified action on each entry.
260 func (ar *Archive) scan(action func(*Entry)) {
271 func listEntry(ar *Archive, entry *Entry, verbose bool) {
280 func (ar *Archive) output(entry *Entry, w io.Writer) {
297 func (ar *Archive) skip(entry *Entry) {
310 func (ar *Archive) match(entry *Entry) bool {
324 // addFiles adds files to the archive. The archive is known to be
327 func (ar *Archive) addFiles() {
352 // addFile adds a single file to the archive
353 func (ar *Archive) addFile(fd FileLike) {
376 // startFile writes the archive entry header.
377 func (ar *Archive) startFile(name string, mtime int64, uid, gid int, mode os.FileMode, size int64) {
385 // endFile writes the archive entry tail (a single byte of padding, if the file size was odd).
386 func (ar *Archive) endFile() {
390 log.Fatal("writing archive: ", err)
396 // addPkgdef adds the __.PKGDEF file to the archive, copied
398 // The archive is known to be empty.
399 func (ar *Archive) addPkgdef() {
466 func (ar *Archive) printContents(entry *Entry) {
478 // It just scans the archive to make sure it's intact.
479 func (ar *Archive) skipContents(entry *Entry) {
484 func (ar *Archive) tableOfContents(entry *Entry) {
492 func (ar *Archive) extractContents(entry *Entry) {