mirror of
https://github.com/ziglang/zig.git
synced 2026-01-03 12:03:19 +00:00
std: handle sharing violation when deleting a file on windows
This commit is contained in:
parent
c803d334d0
commit
f82b1831f7
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user