MCPcopy
hub / github.com/kopia/kopia / goModeToUnixMode

Function goModeToUnixMode

internal/fusemount/fusefs.go:32–48  ·  view source on GitHub ↗
(mode os.FileMode)

Source from the content-addressed store, hash-verified

30}
31
32func goModeToUnixMode(mode os.FileMode) uint32 {
33 unixmode := uint32(mode.Perm())
34
35 if mode&os.ModeSetuid != 0 {
36 unixmode |= 0o4000
37 }
38
39 if mode&os.ModeSetgid != 0 {
40 unixmode |= 0o2000
41 }
42
43 if mode&os.ModeSticky != 0 {
44 unixmode |= 0o1000
45 }
46
47 return unixmode
48}
49
50func populateAttributes(a *fuse.Attr, e fs.Entry) {
51 a.Mode = goModeToUnixMode(e.Mode())

Callers 1

populateAttributesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected