MCPcopy
hub / github.com/restic/restic / nodeFromFileInfo

Function nodeFromFileInfo

internal/fs/node.go:18–28  ·  view source on GitHub ↗

nodeFromFileInfo returns a new node from the given path and FileInfo. It returns the first error that is encountered, together with a node.

(path string, fi *ExtendedFileInfo, ignoreXattrListError bool, warnf func(format string, args ...any))

Source from the content-addressed store, hash-verified

16// nodeFromFileInfo returns a new node from the given path and FileInfo. It
17// returns the first error that is encountered, together with a node.
18func nodeFromFileInfo(path string, fi *ExtendedFileInfo, ignoreXattrListError bool, warnf func(format string, args ...any)) (*data.Node, error) {
19 node := buildBasicNode(path, fi)
20
21 if err := nodeFillExtendedStat(node, path, fi); err != nil {
22 return node, err
23 }
24
25 err := nodeFillGenericAttributes(node, path, fi)
26 err = errors.Join(err, nodeFillExtendedAttributes(node, path, ignoreXattrListError, warnf))
27 return node, err
28}
29
30func buildBasicNode(path string, fi *ExtendedFileInfo) *data.Node {
31 mask := os.ModePerm | os.ModeType | os.ModeSetuid | os.ModeSetgid | os.ModeSticky

Callers 1

ToNodeMethod · 0.85

Calls 5

JoinFunction · 0.92
buildBasicNodeFunction · 0.85
nodeFillExtendedStatFunction · 0.85

Tested by

no test coverage detected