How do I get MAC address using Julia please?
Your question does not seem julia specific.
Also, the answer may depend on the operation system.
Are you trying to find the MAC address of the machine executing the Juia code?
on Windows, the following may help
read(`ipconfig /all`,String)
y = read(`ipconfig /all`,String)
y2 = split(y,"\r\n")
filter(x->occursin("ysic",x),y2)
julia> filter(x->occursin("ysic",x),y2)
7-element Vector{SubString{String}}:
" Physical Address. . . . . . . . . : 00-50-B6-F0-76-45"
" Physical Address. . . . . . . . . : 3C-E9-F7-5B-9F-0F"
" Physical Address. . . . . . . . . : 3C-E9-F7-5B-9F-10"
" Physical Address. . . . . . . . . : 3E-E9-F7-5B-9F-0F"
" Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0"
" Physical Address. . . . . . . . . : 8C-9D-8A-53-59-45"
" Physical Address. . . . . . . . . : 00-15-5D-83-D4-E6"
Thanks. I was wondering if we have something similar to getipaddr() irrespective of the underlying OS (using any package if not std lib)
there is this
https://docs.julialang.org/en/v1/stdlib/Sockets/#Sockets.getipaddr
but I am not sure if it yields the MAC address
In Python, there is a library called getmac
; it looks like something that could be straightforwardly ported to Julia.
(Or you could call it directly from Julia with PyCall or PythonCall, but then you have to deal with installing Python stuff.)