On 31/08/2020 14:59, lampahome wrote:
As title, I read boost.asio documents and generally said io about http/network.
I don't see any info. of io of files. Does boost.asio supportĀ read/write io of files asynchronously?
I haven't tried any of these methods, but it does provide the posix::stream_descriptor and windows::{stream,random_access}_handle classes which should be able to operate on native files. (You'll have to use a native OS-level function to open the handle/descriptor for the file and pass ownership to the ASIO object; they lack means to do the opening itself.) https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/overview/posix/str... https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/overview/windows/s... https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/overview/windows/r... Alternatively, there's another library (that I also haven't used) dedicated to async file I/O. It originally started life based on ASIO but I think it's since diverged into something else. And called something different from the last time I saw it as well. Its current home appears to be: https://ned14.github.io/llfio/ (The impression I have, which may be mistaken, is that it is possibly overkill for general application use, unless you're trying to implement some kind of custom database engine rather than just using an off-the-shelf DB library.)