Hi Any one knows how to get MAC address of a machine who is accessing your application.Help me. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
a method like the one below will find the ethernet mac address of my Mac on OS-X 10.4 def mac_address system "ifconfig | grep lladdr > mac.txt" f = File.new("mac.txt") mac = "" f.each{|l| mac = l.split(" ").last} return mac end It''s really quite hacky, but you''re going to need to make a system call to do that. At least I cannot think of any classes available for it. On windows maybe the Win32ole or Win32API classes but nothing on and BSD platforms. cammo On Feb 21, 10:11 pm, Shiva Kumaran <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi > Any one knows how to get MAC address of a machine who is accessing > your application.Help me. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 21 Feb 2008, at 11:37, cammo wrote:> > a method like the one below will find the ethernet mac address of my > Mac on OS-X 10.4 > > def mac_address > system "ifconfig | grep lladdr > mac.txt" > f = File.new("mac.txt") > mac = "" > f.each{|l| mac = l.split(" ").last} > return mac > end >output = `ifconfig | grep lladd` at least avoids the temporary file unpleasantness (or use IO.popen) Fred> It''s really quite hacky, but you''re going to need to make a system > call to do that. At least I cannot think of any classes available for > it. On windows maybe the Win32ole or Win32API classes but nothing on > and BSD platforms. > > > cammo > > On Feb 21, 10:11 pm, Shiva Kumaran <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> Hi >> Any one knows how to get MAC address of a machine who is accessing >> your application.Help me. >> -- >> Posted viahttp://www.ruby-forum.com/. > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
nearly impossible On 21 фев, 13:11, Shiva Kumaran <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi > Any one knows how to get MAC address of a machine who is accessing > your application.Help me. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---