mitchellh / go-ps

Find, list, and inspect processes from Go (golang).
https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc
MIT License
1.47k stars 251 forks source link

Retrieving the full path of a process #49

Open lprat opened 3 years ago

lprat commented 3 years ago

Hi,

First, thank for you tool! I would like to known if possible to implemente feature to obtains full path of a process. For linux is just read "/proc/PID/exe"... On windows, maybe like https://github.com/kardianos/osext/blob/master/osext_windows.go ...

Thanks. Lionel

mcandre commented 3 years ago

I have a use case of trying to relaunch a list of processes.

In my case, I really need the absolute path to the binaries and other important data, including argv, environment variables, user ID's, and working directory.