authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-14 18:23:16-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-14 18:23:16-04:00
logf54aff46721b04fe43b645f27d3c4dbb8d2cc74d
treed2165399c3fa97a8c036fa60d65084604a59cef0
parent46352f6bfe0a597670fbfc11f3e06f7cf038f2b5

implement io.OutStream.openMode for windows


1 files changed, 11 insertions(+), 1 deletions(-)

std/io.zig+11-1
......@@ -100,7 +100,17 @@ pub const OutStream = struct {
100100 .buffer = undefined,
101101 };
102102 } else if (is_windows) {
103 @compileError("TODO: windows OutStream.openMode");
103 const handle = %return os.windowsOpen(path, system.GENERIC_WRITE,
104 system.FILE_SHARE_WRITE|system.FILE_SHARE_READ|system.FILE_SHARE_DELETE,
105 system.CREATE_ALWAYS, system.FILE_ATTRIBUTE_NORMAL, allocator);
106 return OutStream {
107 .fd = {},
108 .handle = handle,
109 .handle_id = undefined,
110 .index = 0,
111 .buffer = undefined,
112 };
113
104114 } else {
105115 unreachable;
106116 }