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))
| 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. |
| 18 | func 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 | |
| 30 | func buildBasicNode(path string, fi *ExtendedFileInfo) *data.Node { |
| 31 | mask := os.ModePerm | os.ModeType | os.ModeSetuid | os.ModeSetgid | os.ModeSticky |
no test coverage detected