github.com/jlowellwofford/u-root@v1.0.0/xcmds/archive/toc.go (about)

     1  // Copyright 2013 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Archive archives files. The VTOC is at the front; we're not modeling tape drives or
     6  // streams as in tar and cpio. This will greatly speed up listing the archive,
     7  // modifying it, and so on. We think.
     8  // Why a new tool?
     9  package main
    10  
    11  import (
    12  	"fmt"
    13  )
    14  
    15  func toc(files ...string) error {
    16  	for _, v := range files {
    17  		_, vtoc, err := loadVTOC(v)
    18  		if err != nil {
    19  			fmt.Printf("%v", err)
    20  		}
    21  		for _, vv := range vtoc {
    22  			fmt.Printf("%v\n", vv)
    23  		}
    24  	}
    25  	return nil
    26  }