authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-26 14:32:19-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-26 14:32:19-04:00
log5cd4753bea9e8e79bf30217b9d0b7a4485271588
tree78280f36f715e02eea93a3a33fac4e1275012f34
parent33f996bb163568c9bb10e5044ed9df53599a917f

add missing error code for DeleteFileW


2 files changed, 6 insertions(+), 1 deletions(-)

std/io/test.zig+4-1
......@@ -597,7 +597,10 @@ test "c out stream" {
597597
598598 const filename = c"tmp_io_test_file.txt";
599599 const out_file = std.c.fopen(filename, c"w") orelse return error.UnableToOpenTestFile;
600 defer fs.deleteFileC(filename) catch {};
600 defer {
601 _ = std.c.fclose(out_file);
602 fs.deleteFileC(filename) catch {};
603 }
601604
602605 const out_stream = &io.COutStream.init(out_file).stream;
603606 try out_stream.print("hi: {}\n", i32(123));
std/os/windows.zig+2
......@@ -348,6 +348,7 @@ pub const DeleteFileError = error{
348348 FileNotFound,
349349 AccessDenied,
350350 NameTooLong,
351 FileBusy,
351352 Unexpected,
352353};
353354
......@@ -363,6 +364,7 @@ pub fn DeleteFileW(filename: [*]const u16) DeleteFileError!void {
363364 ERROR.ACCESS_DENIED => return error.AccessDenied,
364365 ERROR.FILENAME_EXCED_RANGE => return error.NameTooLong,
365366 ERROR.INVALID_PARAMETER => return error.NameTooLong,
367 ERROR.SHARING_VIOLATION => return error.FileBusy,
366368 else => |err| return unexpectedError(err),
367369 }
368370 }