On Tue, 8 Oct 2019, Alexey Tor. wrote:

Ubuntu 18.x x64. FPC 3.3 trunk.
I get handle of '/proc/version' using func below (e.g. handle=22).
Now I want to get file size of that file. and read all contents into THandleStream. But problem is: THandleSteam.Size gets 0. I guess THandleStream can override GetSize to get size smarter. Maybe someone knows how?
It will be very good, to access /proc/... by streams.

Don't use size. Just read data till you get no more data.

Many streams do not have a size. Socket or IO streams as prime examples.
Some of the encoding/decoding streams also do not have a real size.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to