finding local IP?

Thierry Arbellot thierry.arbellot at wanadoo.fr
Tue Dec 21 11:40:41 EST 2004


On Tuesday, Dec 21, 2004, at 17:27 Europe/Paris, Dar Scott wrote:

>
> On Dec 21, 2004, at 2:14 AM, Thierry Arbellot wrote:
>
>> 2 tricks for OS X and Win 2K
>> theIPAddress is the local IP address of the computer
>>
>> MacOS X
>>     put replaceText(shell("/sbin/ifconfig en0 | head -3 | grep 'inet 
>> ' | cut -d' ' -f 2"),"(\s|\(|\))","") into theIPAddress
>>
>> Windows 2000/XP
>>     put "255.255.255.255:43222" into testSocket
>>     open datagram socket to testSocket
>>     put hostAddress(testSocket) into theIPAddress
>>     close socket testSocket
>
> I think with 2.5, the latter will work on OS X!  It did just now on my 
> system & Revolution 2.5, anyway.  Yay!
>
You're right. Work on my Mac too (10.2.8 and Rev 2.5)
Good to know.

Thierry




More information about the use-livecode mailing list