tags:

views:

76

answers:

1

Is there functionality in C# standard libraries analogous to select()?

In particular, the C# program needs to block waiting on I/O events of multiple file streams (not sockets).

Thanks.

+1  A: 

If you're waiting for someone else to write to the file, you can use System.IO.FileSystemWatcher and look for change events. Otherwise, you can always use FileStream.BeginRead and FileStream.BeginWrite for asynchronous I/O. Neither of those is very similar to select() in terms of interface, but they can achieve the desired result of fast, asynchronous IO.

JSBangs