[erlang-questions] Finding IP addresses in a PC

Jordan Wilberding <>
Tue Oct 3 18:05:22 CEST 2006


On my computer it returns:

{ok,["lo","eth0"]}

But anyways, the strings are just in reverse, so do this:

 lists:map(fun(X) -> lists:reverse(X) end, List)

where List is ["51.0.861.291","100.0.0.721"] in your case.

Thanks!
Jordan Wilberding

Shelton Tang wrote:
> I have one NIC with the address {192,168,0,150} on my Vista machine.
> If I call inet:getiflist(),  it returns
> ["51.0.861.291","100.0.0.721"].
>
> Anybody know how to convert it to a valid format?
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>   




More information about the erlang-questions mailing list