[erlang-questions] Call erlang:port_info/1 from shell

Allen Kim allen.kim@REDACTED
Wed Jun 22 16:00:27 CEST 2011


[ erlang:port_info(Port) || Port <- erlang:ports()].

You can also use lists:foreach instead.

From: "Andy W. Song" <wsongcn@REDACTED<mailto:wsongcn@REDACTED>>
Date: Wed, 22 Jun 2011 08:49:30 -0500
To: erlang-questions <erlang-questions@REDACTED<mailto:erlang-questions@REDACTED>>
Subject: [erlang-questions] Call erlang:port_info/1 from shell

Hi,

If I run erlang:ports() from shell, it shows

[#Port<0.1>,#Port<0.113>,#Port<0.118>,#Port<0.125>,
 #Port<0.513>,#Port<0.526>,#Port<0.201852>,#Port<0.202767>,
 #Port<0.202768>,#Port<0.202769>,#Port<0.202770>,
 #Port<0.202771>,#Port<0.202772>,#Port<0.202773>,
 #Port<0.202774>,#Port<0.202775>,#Port<0.202776>,
 #Port<0.202777>,#Port<0.202778>,#Port<0.202779>,
 #Port<0.202780>,#Port<0.202781>,#Port<0.202782>,
 #Port<0.202783>,#Port<0.202784>,#Port<0.202785>,
 #Port<0.202786>,#Port<0.202787>,#Port<0.202788>|...]

Now I want to call erlang:port_info/1, but I don't know how to build the Port() parameter from say #Port<0.513>. Can anybody help? And BTW, where should I look for the document about this kind of thing?

Thanks
Andy

--
---------------------------------------------------------------
有志者,事竟成,破釜沉舟,百二秦关终属楚
苦心人,天不负,卧薪尝胆,三千越甲可吞吴

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110622/ea572b3a/attachment.htm>


More information about the erlang-questions mailing list