parseFileMode parses a file mode string, adding support for `chmod` unix command like 1 to 4 digital octal values.
(s string)
| 70 | // adding support for `chmod` unix command like |
| 71 | // 1 to 4 digital octal values. |
| 72 | func parseFileMode(s string) (os.FileMode, error) { |
| 73 | modeStr := fmt.Sprintf("%04s", s) |
| 74 | mode, err := strconv.ParseUint(modeStr, 8, 32) |
| 75 | if err != nil { |
| 76 | return 0, err |
| 77 | } |
| 78 | return os.FileMode(mode), nil |
| 79 | } |
| 80 | |
| 81 | // FileWriter can write logs to files. By default, log files |
| 82 | // are rotated ("rolled") when they get large, and old log |
no outgoing calls
no test coverage detected