<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div><div><div>[ erlang:port_info(Port) || Port <- erlang:ports()].</div><div><br></div><div>You can also use lists:foreach instead.</div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-family: Helvetica; font-size: medium; "><font class="Apple-style-span" face="Calibri, sans-serif"><font class="Apple-style-span" face="Helvetica"><br></font></font></div></div></div></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> "Andy W. Song" <<a href="mailto:wsongcn@gmail.com">wsongcn@gmail.com</a>><br><span style="font-weight:bold">Date: </span> Wed, 22 Jun 2011 08:49:30 -0500<br><span style="font-weight:bold">To: </span> erlang-questions <<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>><br><span style="font-weight:bold">Subject: </span> [erlang-questions] Call erlang:port_info/1 from shell<br></div><div><br></div>Hi, <div><br></div><div>If I run erlang:ports() from shell, it shows</div><div><div> </div><div>[#Port<0.1>,#Port<0.113>,#Port<0.118>,#Port<0.125>,</div><div> #Port<0.513>,#Port<0.526>,#Port<0.201852>,#Port<0.202767>,</div><div> #Port<0.202768>,#Port<0.202769>,#Port<0.202770>,</div><div> #Port<0.202771>,#Port<0.202772>,#Port<0.202773>,</div><div> #Port<0.202774>,#Port<0.202775>,#Port<0.202776>,</div><div> #Port<0.202777>,#Port<0.202778>,#Port<0.202779>,</div><div> #Port<0.202780>,#Port<0.202781>,#Port<0.202782>,</div><div> #Port<0.202783>,#Port<0.202784>,#Port<0.202785>,</div><div> #Port<0.202786>,#Port<0.202787>,#Port<0.202788>|...]</div><div><br></div><div>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?</div><div><br></div><div>Thanks</div><div>Andy</div><br>-- <br><div>---------------------------------------------------------------</div><div>有志者,事竟成,破釜沉舟,百二秦关终属楚</div><div>苦心人,天不负,卧薪尝胆,三千越甲可吞吴</div><br></div></span></body></html>