Merge pull request #115 from v1ne/win-fix-appending-to-file

winapi/files: Append to files with FILE_APPEND_DATA
This commit is contained in:
Sönke Ludwig 2019-08-17 14:29:14 +02:00 committed by GitHub
commit 2d0fd8b1e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ final class WinAPIEventDriverFiles : EventDriverFiles {
import std.utf : toUTF16z; import std.utf : toUTF16z;
auto access = mode == FileOpenMode.readWrite || mode == FileOpenMode.createTrunc ? (GENERIC_WRITE | GENERIC_READ) : auto access = mode == FileOpenMode.readWrite || mode == FileOpenMode.createTrunc ? (GENERIC_WRITE | GENERIC_READ) :
mode == FileOpenMode.append ? GENERIC_WRITE : GENERIC_READ; mode == FileOpenMode.append ? FILE_APPEND_DATA : GENERIC_READ;
auto shareMode = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE; auto shareMode = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE;
auto creation = mode == FileOpenMode.createTrunc ? CREATE_ALWAYS : mode == FileOpenMode.append? OPEN_ALWAYS : OPEN_EXISTING; auto creation = mode == FileOpenMode.createTrunc ? CREATE_ALWAYS : mode == FileOpenMode.append? OPEN_ALWAYS : OPEN_EXISTING;