std.os: unlinkW shouldn't return error.DirNotEmpty
This commit is contained in:
committed by
GitHub
parent
fbbccc9d5f
commit
530dc0405c
@@ -2355,7 +2355,10 @@ pub fn unlinkZ(file_path: [*:0]const u8) UnlinkError!void {
|
||||
|
||||
/// Windows-only. Same as `unlink` except the parameter is null-terminated, WTF16 encoded.
|
||||
pub fn unlinkW(file_path_w: []const u16) UnlinkError!void {
|
||||
return windows.DeleteFile(file_path_w, .{ .dir = std.fs.cwd().fd });
|
||||
windows.DeleteFile(file_path_w, .{ .dir = std.fs.cwd().fd }) catch |err| switch (err) {
|
||||
error.DirNotEmpty => unreachable, // we're not passing .remove_dir = true
|
||||
else => |e| return e,
|
||||
};
|
||||
}
|
||||
|
||||
pub const UnlinkatError = UnlinkError || error{
|
||||
|
||||
Reference in New Issue
Block a user