From 3c87d4e14ec6b0c2442372cbcc60174d654edddc Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Mon, 3 Jan 2022 03:51:37 -0800 Subject: [PATCH] Add CANNOT_DELETE as a possible error in os.windows.DeleteFile Can happen when e.g. trying to delete a file with the Read Only flag set --- lib/std/os/windows.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index 0d9907893c..7642fa80f8 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -913,6 +913,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil .FILE_IS_A_DIRECTORY => return error.IsDir, .NOT_A_DIRECTORY => return error.NotDir, .SHARING_VIOLATION => return error.FileBusy, + .CANNOT_DELETE => return error.AccessDenied, else => return unexpectedStatus(rc), } }