How to open and read "/proc/cpuinfo" on Android device in Delphi

  

Could anyone advise me how to open and read/proc/cpuinfo” on Android device in Delphi?

Original code:

var
i: integer;
FS: TFileStream;
LBuffer: TBytes;
begin
if FileExists(‘/proc/cpuinfo’) then
begin
FS:= TFileStream.Create(‘/proc/cpuinfo’, fmOpenRead);
try
SetLength(LBuffer, FS.Size);
FS.ReadBuffer(Pointer(LBuffer)^, Length(LBuffer));
for i:= 0 to Length(LBuffer) – 1 do
Memo1.Lines.Add(LBuffer[i]);
finally
FS.Free;
end;

end;
end;

The problem is that the size of the FS is -1 and is therefore not as read …

Comments are closed.