| ... | @@ -828,7 +828,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil | ... | @@ -828,7 +828,7 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil |
| 828 | } | 828 | } |
| 829 | } | 829 | } |
| 830 | | 830 | |
| 831 | pub const MoveFileError = error{ FileNotFound, Unexpected }; | 831 | pub const MoveFileError = error{ FileNotFound, AccessDenied, Unexpected }; |
| 832 | | 832 | |
| 833 | pub fn MoveFileEx(old_path: []const u8, new_path: []const u8, flags: DWORD) MoveFileError!void { | 833 | pub fn MoveFileEx(old_path: []const u8, new_path: []const u8, flags: DWORD) MoveFileError!void { |
| 834 | const old_path_w = try sliceToPrefixedFileW(old_path); | 834 | const old_path_w = try sliceToPrefixedFileW(old_path); |
| ... | @@ -840,6 +840,7 @@ pub fn MoveFileExW(old_path: [*:0]const u16, new_path: [*:0]const u16, flags: DW | ... | @@ -840,6 +840,7 @@ pub fn MoveFileExW(old_path: [*:0]const u16, new_path: [*:0]const u16, flags: DW |
| 840 | if (kernel32.MoveFileExW(old_path, new_path, flags) == 0) { | 840 | if (kernel32.MoveFileExW(old_path, new_path, flags) == 0) { |
| 841 | switch (kernel32.GetLastError()) { | 841 | switch (kernel32.GetLastError()) { |
| 842 | .FILE_NOT_FOUND => return error.FileNotFound, | 842 | .FILE_NOT_FOUND => return error.FileNotFound, |
| | 843 | .ACCESS_DENIED => return error.AccessDenied, |
| 843 | else => |err| return unexpectedError(err), | 844 | else => |err| return unexpectedError(err), |
| 844 | } | 845 | } |
| 845 | } | 846 | } |