mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 21:07:26 +02:00
Fix file open with append/append_existing flag on Windows
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
* Fix file open with append/append_existing flag on Windows.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 323:
|
Version 323:
|
||||||
|
|
||||||
* Fix clang-cl UTF8 path handling for `file_win32`.
|
* Fix clang-cl UTF8 path handling for `file_win32`.
|
||||||
|
@ -198,11 +198,28 @@ open(char const* path, file_mode mode, error_code& ec)
|
|||||||
creation_disposition,
|
creation_disposition,
|
||||||
flags_and_attributes,
|
flags_and_attributes,
|
||||||
NULL);
|
NULL);
|
||||||
if(h_ == boost::winapi::INVALID_HANDLE_VALUE_)
|
if (h_ == boost::winapi::INVALID_HANDLE_VALUE_)
|
||||||
|
{
|
||||||
ec.assign(boost::winapi::GetLastError(),
|
ec.assign(boost::winapi::GetLastError(),
|
||||||
system_category());
|
system_category());
|
||||||
else
|
return;
|
||||||
ec = {};
|
}
|
||||||
|
if (mode == file_mode::append ||
|
||||||
|
mode == file_mode::append_existing)
|
||||||
|
{
|
||||||
|
boost::winapi::LARGE_INTEGER_ in;
|
||||||
|
in.QuadPart = 0;
|
||||||
|
if (!detail::set_file_pointer_ex(h_, in, 0,
|
||||||
|
boost::winapi::FILE_END_))
|
||||||
|
{
|
||||||
|
ec.assign(boost::winapi::GetLastError(),
|
||||||
|
system_category());
|
||||||
|
boost::winapi::CloseHandle(h_);
|
||||||
|
h_ = boost::winapi::INVALID_HANDLE_VALUE_;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ec = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::uint64_t
|
std::uint64_t
|
||||||
|
Reference in New Issue
Block a user