Many thanks to the community
To reply to Graeme :
why not just use the /sbin/ifconfig output ?
Simply to be more dev compliance... using an external program is slower
and sometime ifconfig doesn't exist or is deleted on target computers.
To reply to Marco :
And the only "good" solution is a po
> > Better, but still Linux only. For a good solution,
> > a resolver unit that accesses libc should be
> > written that is portable (unlike the libc unit)
>
> If I understood correctly, the OP had two questions:
>
> 1. Retrieve a list of interface names on a *linux* system.
> 2. Return the IP ad
I have these two functions in my .bashrc file. You only need to run
"ii" for the cool output. Now back to the question - If it is for
linux only, why not just use the /sbin/ifconfig output. After all, it
is accurate and seem much easier than all those libc/library methods.
I pull the IPs and I
Many Thanks for this way jeff...
/proc/net/dev is more compatible
Impressed it
for your information.
My program will run only on linux system...
Marco van de Voort a écrit :
I would parse /proc/net/dev instead
Better, but still Linux only. For a good solution, a resolver unit that
ac
> I would parse /proc/net/dev instead
Better, but still Linux only. For a good solution, a resolver unit that
accesses libc should be written that is portable (unlike the libc unit)
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://
OK i understand that i using i386 no 64 bits
Marco van de Voort a écrit :
This function works perfectly without need to regex ifconfig... And i
use glibc
I develop only on linux system.
Note that it is linux/x86 only. No 64-bit, or other platforms.
--
David Touzeau --
> This function works perfectly without need to regex ifconfig... And i
> use glibc
> I develop only on linux system.
Note that it is linux/x86 only. No 64-bit, or other platforms.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lis
Many Thanks Jeff and Micha.
This function works perfectly without need to regex ifconfig... And i
use glibc
I develop only on linux system.
Great respects...
Just another question... (this because i came from Windows OS) how can i
list wich interface loaded without need to parse /etc/networks
Jeff Pohlmeyer wrote:
>> > function to read the local IP eth0/eth1 using glibc library.
>
> This one is a little cleaner...
>
> program ip_addr;
> {$MODE OBJFPC}
>
> uses libc;
It doesn't seem like you're using libc specific functions ? You can also
write a fpc 'native' one using fpsocket and f