authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-15 15:24:13-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-15 15:24:13-07:00
logf82b1831f7d39d20451869d7aa94bd84de45fe12
treef650748bcadbd5fe1839b6a019752c7d7f3a56ca
parentc803d334d0b2f376006aa7709c7e282b52e9c987

std: handle sharing violation when deleting a file on windows


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

lib/std/os/windows.zig+2
...@@ -760,6 +760,7 @@ pub const DeleteFileError = error{...@@ -760,6 +760,7 @@ pub const DeleteFileError = error{
760 FileNotFound,760 FileNotFound,
761 AccessDenied,761 AccessDenied,
762 NameTooLong,762 NameTooLong,
763 /// Also known as sharing violation.
763 FileBusy,764 FileBusy,
764 Unexpected,765 Unexpected,
765 NotDir,766 NotDir,
...@@ -824,6 +825,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil...@@ -824,6 +825,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
824 .INVALID_PARAMETER => unreachable,825 .INVALID_PARAMETER => unreachable,
825 .FILE_IS_A_DIRECTORY => return error.IsDir,826 .FILE_IS_A_DIRECTORY => return error.IsDir,
826 .NOT_A_DIRECTORY => return error.NotDir,827 .NOT_A_DIRECTORY => return error.NotDir,
828 .SHARING_VIOLATION => return error.FileBusy,
827 else => return unexpectedStatus(rc),829 else => return unexpectedStatus(rc),
828 }830 }
829}831}