From f54aff46721b04fe43b645f27d3c4dbb8d2cc74d Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 14 Oct 2017 18:23:16 -0400 Subject: [PATCH] implement io.OutStream.openMode for windows --- std/io.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/std/io.zig b/std/io.zig index bbca3896b836b24e33139ecded0c7b73826260e2..001f638f3924cb6c16462a13777c97185c769fb3 100644 --- a/std/io.zig +++ b/std/io.zig @@ -100,7 +100,17 @@ pub const OutStream = struct { .buffer = undefined, }; } else if (is_windows) { - @compileError("TODO: windows OutStream.openMode"); + const handle = %return os.windowsOpen(path, system.GENERIC_WRITE, + system.FILE_SHARE_WRITE|system.FILE_SHARE_READ|system.FILE_SHARE_DELETE, + system.CREATE_ALWAYS, system.FILE_ATTRIBUTE_NORMAL, allocator); + return OutStream { + .fd = {}, + .handle = handle, + .handle_id = undefined, + .index = 0, + .buffer = undefined, + }; + } else { unreachable; } -- 2.54.0