// Make creates a .tar.bz2 file at tarbz2Path containing
// the contents of files listed in filePaths. File paths
// can be those of regular files or directories. Regular
// files are stored at the 'root' of the archive, and
// directories are recursively added.
Make creates a .tar.bz2 file at tarbz2Path containing
the contents of files listed in filePaths. File paths
can be those of regular files or directories. Regular
files are stored at the 'root' of the archive, and
directories are recursively added.
// Make creates a . tar . bz2 file at tarbz2Path containing // the contents of files listed in filePaths . File paths // can be those of regular files or directories . Regular // files are stored at the ' root ' of the archive and // directories are recursively added .
func (tarBz2Format) Make(tarbz2Path string, filePaths []string) error {
	out, err := os.Create(tarbz2Path)
	if err != nil {
		return fmt.Errorf("error creating %s: %v", tarbz2Path, err)
	}
	defer out.Close()
	bz2Writer, err := bzip2.NewWriter(out, nil)
	if err != nil {
		return fmt.Errorf("error compressing %s: %v", tarbz2Path, err)
	}
	defer bz2Writer.Close()
	tarWriter := tar.NewWriter(bz2Writer)
	defer tarWriter.Close()
	return tarball(filePaths, tarWriter, tarbz2Path)
}
func ( tarBz2Format ) Make ( tarbz2Path string , filePaths [ ] string ) error { out , err := os . Create ( tarbz2Path ) if err != nil { return fmt . Errorf ( " " , tarbz2Path , err ) } defer out . Close ( ) bz2Writer , err := bzip2 . NewWriter ( out , nil ) if err != nil { return fmt . Errorf ( " " , tarbz2Path , err ) } defer bz2Writer . Close ( ) tarWriter := tar . NewWriter ( bz2Writer ) defer tarWriter . Close ( ) return tarball ( filePaths , tarWriter , tarbz2Path ) }
Make creates a .tar.bz2 file at tarbz2Path containing
the contents of files listed in filePaths.
Make creates a . tar . bz2 file at tarbz2Path containing the contents of files listed in filePaths .