chriskohlhoff / asio

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

Fix `file_base::append` for both create/open for windows `stream_file`. #1500

Open Ramirisu opened 4 days ago

Ramirisu commented 4 days ago

My previous PR didn't resolve the issue completely, so I create this to propose new fixes. The PR only affects stream_file for the windows platform.

Seek to the end of file when opening with flags:

  1. w/r + append (open existing file) -> OPEN_EXISTING
  2. w/r + create + append (open existing file or create if the file doesn't exist) -> OPEN_ALWAYS

Tested on Windows 10 22H2 19025.