diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-10-14 18:23:16 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-10-14 18:23:16 -0400 |
| commit | f54aff46721b04fe43b645f27d3c4dbb8d2cc74d (patch) | |
| tree | d2165399c3fa97a8c036fa60d65084604a59cef0 /std | |
| parent | 46352f6bfe0a597670fbfc11f3e06f7cf038f2b5 (diff) | |
| download | zig-f54aff46721b04fe43b645f27d3c4dbb8d2cc74d.tar.gz zig-f54aff46721b04fe43b645f27d3c4dbb8d2cc74d.zip | |
implement io.OutStream.openMode for windows
Diffstat (limited to 'std')
| -rw-r--r-- | std/io.zig | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/std/io.zig b/std/io.zig index bbca3896b8..001f638f39 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; } |
