Reputation: 135
Is there a way to get a registered name if you have a PID?
Upvotes: 6
Views: 1892
Reputation: 7129
I'm assuming you want this for some kind of debugging/introspection purpose and not for general use in your code:
erlang:process_info(Pid, registered_name).
Gives you []
if the process doesn't have a locally registered name, and {registered_name, Name}
if there is one.
Upvotes: 6