[fpc-pascal] cannot read /sys/class/net/eth1/address even as root user on linux
Michael Van Canneyt
michael at freepascal.org
Thu Dec 5 12:45:40 CET 2013
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',
> it raised "stream read error"
home: >cat t.pp
uses sysutils, classes;
S : String;
with TFileStream.Create('/sys/class/net/eth1/address', fmOpenRead+fmShareDenyWrite) do
Works fine here. Permission problem on your machine maybe ?
More information about the fpc-pascal