File reading position

When reading a file where can we track the absolute current position?
pos does not seem to work. logicalPos() also not…

I think you need reader.seek property. But I am not sure…

You can read more in official docs of reader interface

That is a buffer property.

/// Number of bytes which have been consumed from `buffer`.
seek: usize,

you need seekTo on the file reader (or writer).
file_reader.seekTo(pos);

ok but… I only want to know the current position during reading. Not seeking.

oops, i think it is logicalPos() after all..

1 Like