On 7/3/07, ara.t.howard <ara.t.howard / gmail.com> wrote:
>
> On Jul 3, 2007, at 9:52 AM, Robert Dober wrote:
>
> > On 7/3/07, ara.t.howard <ara.t.howard / gmail.com> wrote:
> > <snip>
> >>
> >> thanks!
> >>
> >> -a
> >> --
> > Nope on Linux
> >
>
> huh.  does for me!?


It seems to assume ifconfig is in the $PATH, which on many distros is
not the normal state of affairs for a non-root user (ifconfig tends to
live in /sbin, I think).

-A


> > def mac_address
> >      return @mac_address if defined? @mac_address
> >      re =  %r<(?:hwaddr|:)\s+((?:[0-9a-f]{1,2}[-:]){5}[0-9a-f]{1,2})
> > \s*$>i
> >      lines =
> >        begin
> >          IO.popen('ifconfig'){|fd| fd.readlines}
> >        rescue
> >          IO.popen('ipconfig /all'){|fd| fd.readlines}
> >        end
> >      candidates = lines.map{|l| re.match( l )[1] rescue nil }.compact
> >      @mac_address = candidates.first
> >    end
> >
> > but not tested on Windows
> > HTH
> > Robert
> > --
>
> can someone give this version a whirl on windows?
>
> -a