MCPcopy Create free account
hub / github.com/prometheus/procfs / Comm

Method Comm

proc.go:165–172  ·  view source on GitHub ↗

Comm returns the command name of a process.

()

Source from the content-addressed store, hash-verified

163
164// Comm returns the command name of a process.
165func (p Proc) Comm() (string, error) {
166 data, err := parsers.ReadFileNoStat(p.path("comm"))
167 if err != nil {
168 return "", err
169 }
170
171 return strings.TrimSpace(string(data)), nil
172}
173
174// Executable returns the absolute path of the executable command of a process.
175func (p Proc) Executable() (string, error) {

Callers 1

TestCommFunction · 0.80

Calls 2

pathMethod · 0.95
ReadFileNoStatFunction · 0.92

Tested by 1

TestCommFunction · 0.64