Re: How can I get pathname from pid ?

Willy Tarreau (willy@novworld.Novecom.Fr)
Sun, 20 Jun 1999 00:57:35 +0200 (CEST)


[ Hmm, I suspect your mailer is misconfigured, you encode all your text
as base64. ]

So your message was (thanks to mmencode) :
>
> How can I get the full pathname of a process from its pid ?
>
> Can you please help me ?
> I really need your help .
>
> Thanks in advance .
>
> - Lee -

As "the pathname of a process" isn't meaningful, I suppose you are trying to
get either the working directory of a process or the full pathname of the
executable.

They both can be found in /proc/#pid/ with names cwd and exe. They are symbolic
links to the directory and file (respectively), so you can even use them in
you shell scripts.

Cheers,

Willy

--

[ The difference between elm and OutLook : one of them is difficult to setup. The other one only needs a vt100 to run. ]

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/