| ... | @@ -865,7 +865,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil | ... | @@ -865,7 +865,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil |
| 865 | } | 865 | } |
| 866 | } | 866 | } |
| 867 | | 867 | |
| 868 | pub const MoveFileError = error{ FileNotFound, Unexpected }; | 868 | pub const MoveFileError = error{ FileNotFound, AccessDenied, Unexpected }; |
| 869 | | 869 | |
| 870 | pub fn MoveFileEx(old_path: []const u8, new_path: []const u8, flags: DWORD) MoveFileError!void { | 870 | pub fn MoveFileEx(old_path: []const u8, new_path: []const u8, flags: DWORD) MoveFileError!void { |
| 871 | const old_path_w = try sliceToPrefixedFileW(old_path); | 871 | const old_path_w = try sliceToPrefixedFileW(old_path); |
| ... | @@ -877,6 +877,7 @@ pub fn MoveFileExW(old_path: [*:0]const u16, new_path: [*:0]const u16, flags: DW | ... | @@ -877,6 +877,7 @@ pub fn MoveFileExW(old_path: [*:0]const u16, new_path: [*:0]const u16, flags: DW |
| 877 | if (kernel32.MoveFileExW(old_path, new_path, flags) == 0) { | 877 | if (kernel32.MoveFileExW(old_path, new_path, flags) == 0) { |
| 878 | switch (kernel32.GetLastError()) { | 878 | switch (kernel32.GetLastError()) { |
| 879 | .FILE_NOT_FOUND => return error.FileNotFound, | 879 | .FILE_NOT_FOUND => return error.FileNotFound, |
| | 880 | .ACCESS_DENIED => return error.AccessDenied, |
| 880 | else => |err| return unexpectedError(err), | 881 | else => |err| return unexpectedError(err), |
| 881 | } | 882 | } |
| 882 | } | 883 | } |