Detect EOF using winapi

Hello, hi can i detect end of file using winapi? My program uses CreateFile() function to open files and disks.
Thanks!
Last edited on
I suppose that you use ReadFile() to read the file. If so, ReadFile() + GetLastError() will signal the end of file.

From MSDN:
If the ReadFile function attempts to read past the end of the file, the function returns zero, and GetLastError returns ERROR_HANDLE_EOF.


http://msdn.microsoft.com/en-us/library/aa365467%28VS.85%29.aspx
Topic archived. No new replies allowed.