Executable returns the absolute path of the executable command of a process.
()
| 173 | |
| 174 | // Executable returns the absolute path of the executable command of a process. |
| 175 | func (p Proc) Executable() (string, error) { |
| 176 | exe, err := os.Readlink(p.path("exe")) |
| 177 | if os.IsNotExist(err) { |
| 178 | return "", nil |
| 179 | } |
| 180 | |
| 181 | return exe, err |
| 182 | } |
| 183 | |
| 184 | // Cwd returns the absolute path to the current working directory of the process. |
| 185 | func (p Proc) Cwd() (string, error) { |