Skip to content

Commit

Permalink
implement io.OutStream.openMode for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Oct 14, 2017
1 parent 46352f6 commit f54aff4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion std/io.zig
Expand Up @@ -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;
}
Expand Down

0 comments on commit f54aff4

Please sign in to comment.