| ... | ... | @@ -1650,7 +1650,7 @@ pub fn renameatW( |
| 1650 | 1650 | new_path_w: [*:0]const u16, |
| 1651 | 1651 | ReplaceIfExists: windows.BOOLEAN, |
| 1652 | 1652 | ) RenameError!void { |
| 1653 | | const access_mask = windows.SYNCHRONIZE | windows.GENERIC_WRITE; |
| 1653 | const access_mask = windows.SYNCHRONIZE | windows.GENERIC_WRITE | windows.DELETE; |
| 1654 | 1654 | const src_fd = try windows.OpenFileW(old_dir_fd, old_path, null, access_mask, windows.FILE_OPEN); |
| 1655 | 1655 | defer windows.CloseHandle(src_fd); |
| 1656 | 1656 | |
| ... | ... | @@ -1664,7 +1664,7 @@ pub fn renameatW( |
| 1664 | 1664 | |
| 1665 | 1665 | rename_info.* = .{ |
| 1666 | 1666 | .ReplaceIfExists = ReplaceIfExists, |
| 1667 | | .RootDirectory = if (std.fs.path.isAbsoluteWindowsW(new_path_w)) null else new_dir_fd, |
| 1667 | .RootDirectory = if (old_dir_fd == new_dir_fd or std.fs.path.isAbsoluteWindowsW(new_path_w)) null else new_dir_fd, |
| 1668 | 1668 | .FileNameLength = @intCast(u32, new_path.len * 2), // already checked error.NameTooLong |
| 1669 | 1669 | .FileName = undefined, |
| 1670 | 1670 | }; |