authorgravatar for der.teufel.mail@gmail.comKrzysztof Wolicki <der.teufel.mail@gmail.com> 2023-10-19 14:59:52+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-10-19 12:59:52+00:00
log530dc0405c9f48fa3b241f078cf815164e4448ab
tree5282d94625789d649ccdb06a4d090cb7d8ade546
parentfbbccc9d5faa3f253af147e949b7a18724d5d71c
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

std.os: unlinkW shouldn't return error.DirNotEmpty


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

lib/std/os.zig+4-1
......@@ -2355,7 +2355,10 @@ pub fn unlinkZ(file_path: [*:0]const u8) UnlinkError!void {
23552355
23562356/// Windows-only. Same as `unlink` except the parameter is null-terminated, WTF16 encoded.
23572357pub fn unlinkW(file_path_w: []const u16) UnlinkError!void {
2358 return windows.DeleteFile(file_path_w, .{ .dir = std.fs.cwd().fd });
2358 windows.DeleteFile(file_path_w, .{ .dir = std.fs.cwd().fd }) catch |err| switch (err) {
2359 error.DirNotEmpty => unreachable, // we're not passing .remove_dir = true
2360 else => |e| return e,
2361 };
23592362}
23602363
23612364pub const UnlinkatError = UnlinkError || error{