[fpc-pascal] Find out local IP adress

Travis Siegel tsiegel at softcon.com
Mon Mar 23 17:37:27 CET 2009


You could always exec ifconfig, then parce the output for the  
interfaces, and pull the ips from there.
I do this on OSX with a simple terminal script like this:
ifconfig|grep broadcast|awk '{print $2}';
This could easily be made to work on linux/bsd/fpc with very little  
work.
Hope this helps.


On Mar 22, 2009, at 2:21 PM, Rainer Stratmann wrote:

> For Windows there ist gethostbyname.
>
> But for Linux I am searching for this function.
>
> The unit inet is not on the distribution I have (knoppix)
> And libc also does the compiler not know.
>
> May be there exists another way to find out the local IP adress.
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list