lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Mar 18, 2010 at 2:21 PM, Valerio Schiavoni
<valerio.schiavoni@gmail.com> wrote:
> one way to do it is to parse the result of:
> os.execute("ifconfig")

Indeed!
~$ /sbin/ifconfig
eth4      Link encap:Ethernet  HWaddr 00:0C:29:D5:8D:DF
...
On windows, the incantation is 'ipconfig /all'  (note the 'p').  This
is very verbose, but there will be an entry for your ethernet card:

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : csir.co.za
        Description . . . . . . . . . . . : Intel(R) 82566DM-2 Gigabit
Network ...
        Physical Address. . . . . . . . . : 00-21-9B-6F-0F-19
        Dhcp Enabled. . . . . . . . . . . : Yes
        ....

In both cases, io.popen is your friend.

steve d.