Registered name of a process from its PID

martin j logan martin@REDACTED
Wed May 14 20:59:51 CEST 2003


Hello Corrado,
    A simple way to discover the registered name of a process given a
pid() is to use:

process_info(Pid) -> InfoList

this will return a list of tuples where one will be

{registered_name, Atom}

An even more straightforward approach would be to use:

process_info(Pid, registered_name).


Cheers,
Martin


On Wed, 2003-05-14 at 13:22, Corrado Santoro wrote:
> Hi all,
> before I start to write lines of code using registered/0 and whereis/1 BIFs, I 
> would like to know if there is a BIF to obtain the registered name of process 
> starting from its PID. Something like the inverse of the whereis/1 function.
> 
> Thanks,
> -Corrado
-- 
martin j logan <martin@REDACTED>




More information about the erlang-questions mailing list