MCPcopy
hub / github.com/kopia/kopia / BeginDirectory

Method BeginDirectory

snapshot/restore/tar_output.go:26–45  ·  view source on GitHub ↗

BeginDirectory implements restore.Output interface.

(_ context.Context, relativePath string, d fs.Directory)

Source from the content-addressed store, hash-verified

24
25// BeginDirectory implements restore.Output interface.
26func (o *TarOutput) BeginDirectory(_ context.Context, relativePath string, d fs.Directory) error {
27 if relativePath == "" {
28 return nil
29 }
30
31 h := &tar.Header{
32 Name: relativePath + "/",
33 ModTime: d.ModTime(),
34 Mode: int64(d.Mode()),
35 Uid: int(d.Owner().UserID),
36 Gid: int(d.Owner().GroupID),
37 Typeflag: tar.TypeDir,
38 }
39
40 if err := o.tf.WriteHeader(h); err != nil {
41 return errors.Wrap(err, "error writing tar header")
42 }
43
44 return nil
45}
46
47// FinishDirectory implements restore.Output interface.
48//

Callers

nothing calls this directly

Calls 3

OwnerMethod · 0.65
ModTimeMethod · 0.45
ModeMethod · 0.45

Tested by

no test coverage detected