Skip to content

Commit f54aff4

Browse files
committed
implement io.OutStream.openMode for windows
1 parent 46352f6 commit f54aff4

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

std/io.zig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
}

0 commit comments

Comments
 (0)