Closed
Description
While we can read and write to files asynchronously on Windows (by passing blocking: false
so FILE_FLAG_OVERLAPPED
is set), trying to append to an existing file will actually overwrite the file.
The following example is an extract from spec/std/file_spec.cr
that reproduces the problem:
path = "append.txt"
File.write(path, "hello", blocking: false)
p File.read(path, blocking: false)
# => "hello"
File.write(path, " world", mode: "a", blocking: false)
p File.read(path, blocking: false)
# => " world"