Ya this is the issue, I am writing code generic to all OS (windows 7, XP, mac) so ioctl wont be good to use.
Nitin K On Thu, Apr 14, 2011 at 7:15 PM, Noufal Ibrahim <nou...@gmail.com> wrote: > On Thu, Apr 14 2011, Ruchir Shukla wrote: > > > here is a sample code > > > > > >>>> import fcntl, socket, struct > >>>> > >>>> def getHwAddr(ifname): > > ... s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > > ... info = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', > > ifname[:15])) > > ... return ''.join(['%02x:' % ord(char) for char in > info[18:24]])[:-1] > > ... > >>>> print getHwAddr('eth0') > > [...] > > The IOCTL request code is probably platform specific. Does it work on > MacOS? > > -- > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- Nitin K _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers