MCPcopy Create free account
hub / github.com/antonmedv/gitmal / numericPermToLetters

Function numericPermToLetters

pkg/git/utils.go:27–45  ·  view source on GitHub ↗
(perm int)

Source from the content-addressed store, hash-verified

25}
26
27func numericPermToLetters(perm int) string {
28 // Map each octal digit to rwx letters
29 lookup := map[int]string{
30 0: "---",
31 1: "--x",
32 2: "-w-",
33 3: "-wx",
34 4: "r--",
35 5: "r-x",
36 6: "rw-",
37 7: "rwx",
38 }
39
40 u := perm / 100 // user
41 g := (perm / 10) % 10 // group
42 o := perm % 10 // others
43
44 return lookup[u] + lookup[g] + lookup[o]
45}
46
47// IsBinary performs a heuristic check to determine if data is binary.
48// Rules:

Callers 1

ParseFileModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected