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

2014-01-03 Thread Michael Van Canneyt
On Fri, 3 Jan 2014, Dennis Poon wrote: Michael Van Canneyt wrote: 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 :=

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

2014-01-02 Thread Dennis Poon
Michael Van Canneyt wrote: 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/add

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 eth0

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 := TFileStream.Create('/sys/class/net/eth1/add

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 "s

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', fmOpenRead+fmShareDeny

[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" I