Skip to content

Commit 3c87d4e

Browse files
squeek502andrewrk
authored andcommitted
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
1 parent 5b0be0d commit 3c87d4e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/std/os/windows.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
913913
.FILE_IS_A_DIRECTORY => return error.IsDir,
914914
.NOT_A_DIRECTORY => return error.NotDir,
915915
.SHARING_VIOLATION => return error.FileBusy,
916+
.CANNOT_DELETE => return error.AccessDenied,
916917
else => return unexpectedStatus(rc),
917918
}
918919
}

0 commit comments

Comments
 (0)