chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.72k stars 1.19k forks source link

Move file offset to the end when `file_base::append` is specified for windows iocp file service. #1448

Closed Ramirisu closed 3 months ago

Ramirisu commented 3 months ago

asio::file_base::append has no effect when opening asio::stream_file on windows due to the lack of equivalent functionality of O_APPEND for Window APIs.

The workaround is to move the file offset to the end after opening the file for the win_iocp_file_service::open(), or the documentation should mention such limitation ?

O_APPEND: always write the data to the end of file no matter where the file offset is.