May 16, 2021, 12:25:33 PMMay 16
I'm reading a file synchronously and non-overlapped using ReadFile. I'm
also reading the file blockwise, and do not want to deal with an empty block
when the filesize turns out to be an exact multiple of the blocksize (every
block must contain data).
IOW, how do I detect the EOF /without/ trying to use ReadFile and getting
zero bytes back.
I've tried a ReadFile of zero bytes, but that doesn't quite work. :-\
I can ofcourse get and store the filesize beforehand and for each block
subtract the ammount of bytes read, but that means I have duplicate data :
a file that ends and a counter that /should/ than be zero. Which I would
rather not have.
I've ofcourse already DDGed the intarwebz for a hint, but have had not luck.