2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-19 16:12:09 +00:00

6 Commits

Author SHA1 Message Date
Christopher Kohlhoff
1afbc5c12b Update copyright notices. 2025-03-04 22:57:26 +11:00
Rene Rivera
a31cca5ec1 Add support for modular build structure. 2024-10-31 21:42:07 +11:00
Christopher Kohlhoff
c36d3ef338 Update copyright notices. 2024-03-05 07:51:17 +11:00
Christopher Kohlhoff
35e93e4e90 Update copyright notices. 2023-03-01 23:03:03 +11:00
Christopher Kohlhoff
ff58013a23 Update copyright notices. 2022-03-02 21:23:52 +11:00
Christopher Kohlhoff
c6b9f33dcf Add support for files.
This change adds support for stream-oriented and random-access files.
For example, to write to a newly created stream-oriented file:

  asio::stream_file file(
      my_io_context, "/path/to/file",
      asio::stream_file::write_only
        | asio::stream_file::create
        | asio::stream_file::truncate);

  file.async_write_some(my_buffer,
      [](error_code e, size_t n)
      {
        // ...
      });

or to read from a random-access file:

  asio::random_access_file file(
      my_io_context, "/path/to/file",
      asio::random_access_file::read_only);

  file.async_read_some_at(1234, my_buffer,
      [](error_code e, size_t n)
      {
        // ...
      });

This feature currently supports I/O completion ports on Windows, and
io_uring on Linux (define BOOST_ASIO_HAS_IO_URING to enable).
2021-10-25 12:15:08 +11:00