(perm int)
| 25 | } |
| 26 | |
| 27 | func 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: |