| author | |
| committer | |
| log | f4d6b37068db7ef3b5828dbe2403e65bf64a0f2c |
| tree | 0411c9a85e48d316ccfae9daa4e9c8bf2a3e5fa4 |
| parent | 2de08633800cd458fa657afed25a821236520cd8 |
Unfortunately, error.AccessDenied is ambiguous on Windows when it is
returned from fs.rename.2 files changed, 4 insertions(+), 1 deletions(-)
lib/std/os.zig+3| ... | ... | @@ -2414,6 +2414,9 @@ pub fn unlinkatW(dirfd: fd_t, sub_path_w: []const u16, flags: u32) UnlinkatError |
| 2414 | 2414 | pub const RenameError = error{ |
| 2415 | 2415 | /// In WASI, this error may occur when the file descriptor does |
| 2416 | 2416 | /// not hold the required rights to rename a resource by path relative to it. |
| 2417 | /// | |
| 2418 | /// On Windows, this error may be returned instead of PathAlreadyExists when | |
| 2419 | /// renaming a directory over an existing directory. | |
| 2417 | 2420 | AccessDenied, |
| 2418 | 2421 | FileBusy, |
| 2419 | 2422 | DiskQuota, |
src/Package.zig+1-1| ... | ... | @@ -570,7 +570,7 @@ fn renameTmpIntoCache( |
| 570 | 570 | }; |
| 571 | 571 | continue; |
| 572 | 572 | }, |
| 573 | error.PathAlreadyExists => { | |
| 573 | error.PathAlreadyExists, error.AccessDenied => { | |
| 574 | 574 | // Package has been already downloaded and may already be in use on the system. |
| 575 | 575 | cache_dir.deleteTree(tmp_dir_sub_path) catch |del_err| { |
| 576 | 576 | std.log.warn("unable to delete temp directory: {s}", .{@errorName(del_err)}); |