I tried to read the mac address in the captioned file path.
In terminal, I can simply 'cat' and display the mac address.

In FPC, when I tried to use TFileStream to read it,

FS := TFileStream.Create('/sys/class/net/eth1/address', fmOpenRead+fmShareDenyWrite);

it raised "stream read error"

If I tried to use TextFile and readln, it even halted the program.

My question is:
Why 'cat' command can easily display this special file 'address' but TFileStream cannot.

I was told to use this method to get the MAC address of a network card, what other methods are there?

Dennis
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to