On Sun, Feb 28, 2010 at 11:48 AM, Paul Dugas <paul@dugas.cc> wrote:
Sorry, should have mentioned I'm not on Windows; Linux is the target.
The posix::stream_descriptor looked promising until I read the "but
not regular files" bit.
This is a serious limitation of asio, and has been for a long time. It's possible there will be an equivalent of windows::random_access_handle for posix sometime in the near future, but that's about all I can say right now.
You can "fake it" without too much complicated work by copying the interface of windows_random_access_handle and filling out the routines with logic to send requests to a thread pool (also managed in asio) and executing synchronous i/o operations inside the thread pool and then invoking the callbacks on the main thread.