MCPcopy Create free account
hub / github.com/aitjcize/Overlord / GetProcessWorkingDirectory

Function GetProcessWorkingDirectory

overlord/sysutils_linux.go:95–97  ·  view source on GitHub ↗

GetProcessWorkingDirectory returns the current working directory of a process.

(pid int)

Source from the content-addressed store, hash-verified

93
94// GetProcessWorkingDirectory returns the current working directory of a process.
95func GetProcessWorkingDirectory(pid int) (string, error) {
96 return os.Readlink(fmt.Sprintf("/proc/%d/cwd", pid))
97}
98
99// Ttyname returns the TTY name of a given file descriptor.
100func Ttyname(fd uintptr) (string, error) {

Callers 2

Calls

no outgoing calls

Tested by 1