Exemple #1
0
func doFile(f *os.File, h record.RecordHeader, cur *Directory, t uint32) error {
	file, err := record.ReadFile(f, h)
	if err != nil {
		return err
	}

	me := FromFileRecord(h, file, t)
	me.Path = cur.Path + me.Name
	cur.Files = append(cur.Files, me)
	return nil
}
Exemple #2
0
func doFile(h record.RecordHeader, f *os.File, path string) []byte {
	r, err := record.ReadFile(f, h)
	if err != nil {
		fatalf("Cannot read file in %s: %s", path, err)
	}

	fn := path + r.Name
	b(fn, r.Digest)
	af := afs.FromFileRecord(h, r, 0)
	data, err := af.Content()
	if err != nil {
		fmt.Printf("%s\n", err)
		os.Exit(1)
	}
	c(r.Digest, data)
	return r.Digest
}