From 2203dd78bbf1781e4764082ce223faddd6f11007 Mon Sep 17 00:00:00 2001 From: joboet Date: Fri, 19 Jun 2026 15:02:10 +0200 Subject: [PATCH] std: correctly report file size on UWP --- library/std/src/sys/fs/windows.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/fs/windows.rs b/library/std/src/sys/fs/windows.rs index fef3c0665eda1..e3e7b081b47d5 100644 --- a/library/std/src/sys/fs/windows.rs +++ b/library/std/src/sys/fs/windows.rs @@ -597,7 +597,7 @@ impl File { (&raw mut info) as *mut c_void, size as u32, ))?; - attr.file_size = info.AllocationSize as u64; + attr.file_size = info.EndOfFile as u64; attr.number_of_links = Some(info.NumberOfLinks); if attr.attributes & c::FILE_ATTRIBUTE_REPARSE_POINT != 0 { let mut attr_tag: c::FILE_ATTRIBUTE_TAG_INFO = mem::zeroed();