aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-09-15 15:24:13 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-09-15 15:24:13 -0700
commitf82b1831f7d39d20451869d7aa94bd84de45fe12 (patch)
treef650748bcadbd5fe1839b6a019752c7d7f3a56ca /lib/std
parentc803d334d0b2f376006aa7709c7e282b52e9c987 (diff)
downloadzig-f82b1831f7d39d20451869d7aa94bd84de45fe12.tar.gz
zig-f82b1831f7d39d20451869d7aa94bd84de45fe12.zip
std: handle sharing violation when deleting a file on windows
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/os/windows.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig
index bd9dc8b32e..405f7438f5 100644
--- a/lib/std/os/windows.zig
+++ b/lib/std/os/windows.zig
@@ -760,6 +760,7 @@ pub const DeleteFileError = error{
FileNotFound,
AccessDenied,
NameTooLong,
+ /// Also known as sharing violation.
FileBusy,
Unexpected,
NotDir,
@@ -824,6 +825,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
.INVALID_PARAMETER => unreachable,
.FILE_IS_A_DIRECTORY => return error.IsDir,
.NOT_A_DIRECTORY => return error.NotDir,
+ .SHARING_VIOLATION => return error.FileBusy,
else => return unexpectedStatus(rc),
}
}