While your method should work if that file actually exists, you probably
want to use libudev for enumerating and getting device information from
sysfs. libudev will also enable you to get hotplug notification.
For your your reply.
The fact is:
1) my linux distro starts with eth1 not eth0
Hallo Mark,
I have a minimal telnet server in my Projekt OpenMSR.
Information about OpenMSR on the webpage at
www.openmsr.org. The source is hosted at sf.
If you check it out you find the telnet server in the
directory DeviceServer. Check the code in DeviceServer.pas
for usage.
Kind regards
Hartm
On Thu, Dec 05, 2013 at 07:33:38PM +0800, Dennis Poon wrote:
> 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/add
Dennis Poon wrote:
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 "s
On Thu, 5 Dec 2013, Dennis Poon wrote:
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+fmShareDeny
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"
I