[fpc-pascal] cannot read /sys/class/net/eth1/address even as root user on linux

2013-12-05 Thread Dennis Poon
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

Re: [fpc-pascal] cannot read /sys/class/net/eth1/address even as root user on linux

2013-12-05 Thread Michael Van Canneyt
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',

Re: [fpc-pascal] cannot read /sys/class/net/eth1/address even as root user on linux

2013-12-05 Thread Mark Morgan Lloyd
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

Re: [fpc-pascal] cannot read /sys/class/net/eth1/address even as root user on linux

2013-12-05 Thread Henry Vermaak
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 :=

[fpc-pascal] RE: Minimal telnet server

2013-12-05 Thread Hartmut Eilers
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

Re: [fpc-pascal] cannot read /sys/class/net/eth1/address even as root user on linux

2013-12-05 Thread Dennis Poon
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