Win32 select / poll / eof / ANYTHING?

Using the standard Win32 I / O API (CreateFile / ReadFile / etc), I try to wait until the file becomes readable, or to be excluded from the file. If Windows had some decent POSIX support, I could just do:

select(file_count, files_waiting_for_read, NULL, files_waiting_for_excpt, NULL, NULL);

And the choice will return when there is something interesting in some files. Windows does not support selection or polling. Good. I decided that I could take the file and do something like:

while(eof(file_descriptor))
{
    Sleep(100);
}

The above loop will end when more data is available for reading. But no, Windows also does not have the equivalent of eof ()! I could call ReadFile () on the file and determine if it would be on eof that way. But then I will have to process the reading at that point in time - I hope to just understand that the file is readable without reading it.

What are my options?

+5
2

Windows -. - /.

, Winsock select(), POSIX, .

+7

All Articles