MCPcopy
hub / github.com/caddyserver/caddy / parseFileMode

Function parseFileMode

modules/logging/filewriter.go:72–79  ·  view source on GitHub ↗

parseFileMode parses a file mode string, adding support for `chmod` unix command like 1 to 4 digital octal values.

(s string)

Source from the content-addressed store, hash-verified

70// adding support for `chmod` unix command like
71// 1 to 4 digital octal values.
72func 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

Callers 3

UnmarshalJSONMethod · 0.85
OpenWriterMethod · 0.85
UnmarshalCaddyfileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected