[erlang-questions] Pid, port connection syntax

Vlad Dumitrescu vladdu55@REDACTED
Thu Dec 14 20:03:21 CET 2006


Hi,

On 12/14/06, kg9020@REDACTED <kg9020@REDACTED> wrote:
>
> I am looking for  documentation that shows how to connect to port
> port_command(Port, Data) .... i know the port is the Pid,
> i have not been able to find format ....
> example PID <0.153>
> so is it port_command(< 0.153> or 0.153 or 153 or ...... man says PID but
> does not say the
> format of PID ... as from the shell i see most pids  as <0.XXXX> ... so if
> some one can point to where in documentation I can find this information ...
> thanks
>

You can't enter pids as text in a program. They are returned by spawn and
can be sent to other processes.

That said, there is a debugging feature that allows you to dynamically build
pids: the function c:pid(A,B,C) returns <A.B.C>. However, this is useless
except for debugging, since if you can't know A, B and C but from a pid you
received from elsewhere, so you can just as well use the pid directly.

regards,
Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20061214/60b19825/attachment.htm>


More information about the erlang-questions mailing list