S
Senthil
Hi,
The need is to read each line in a text file and based on the read
data decision has to be taken whether to reposition the file pointer. The
StreamReader.Position does not give current position. But it gives position
in multiples of 1024. Also, I am not finding a way to reposition the pointer
using FileStream-StreamReader combination. Due to this the condition
(FileLength = = File Position) misbehaves.
I did some investigation and found out only when i use Read method the file
pointer position gets updated after each read operation. Is there any way by
using the StreamReader-FileStream combination can it be done?
How could such file pointer reposition and tracking file pointer position
could be done elegantly in C# ?
Can anyone help?
Thanks,
Senthil
C# code:
The need is to read each line in a text file and based on the read
data decision has to be taken whether to reposition the file pointer. The
StreamReader.Position does not give current position. But it gives position
in multiples of 1024. Also, I am not finding a way to reposition the pointer
using FileStream-StreamReader combination. Due to this the condition
(FileLength = = File Position) misbehaves.
I did some investigation and found out only when i use Read method the file
pointer position gets updated after each read operation. Is there any way by
using the StreamReader-FileStream combination can it be done?
How could such file pointer reposition and tracking file pointer position
could be done elegantly in C# ?
Can anyone help?
Thanks,
Senthil
C# code: