简体   繁体   中英

Copying file in Windows 10 changes its size

I copied a large file to a new directory in Windows 10 by dragging the file from Explorer to a folder in Eclipse. The file size of the copied file changed even though fc shows the original and new files as identical. The original file has a size of 209,715,200 bytes (200 MiB):

c:\>dir c:\Users\GeoffAlexander\Documents\Python\200MiB.txt
 Volume in drive C is Windows
 Volume Serial Number is 0447-709A

 Directory of c:\Users\GeoffAlexander\Documents\Python

08/13/2019  09:42 AM       209,715,200 200MiB.txt
               1 File(s)    209,715,200 bytes
               0 Dir(s)  268,331,835,392 bytes free

The new file has a size of 211,812,352 bytes:

c:\>dir c:\Users\GeoffAlexander\Desktop\200MiB.txt
 Volume in drive C is Windows
 Volume Serial Number is 0447-709A

 Directory of c:\Users\GeoffAlexander\Desktop

08/15/2019  09:11 AM       211,812,352 200MiB.txt
               1 File(s)    211,812,352 bytes
               0 Dir(s)  268,232,798,208 bytes free

The fc command shows the files as being identical:

c:\>fc c:\Users\GeoffAlexander\Documents\Python\200MiB.txt c:\Users\GeoffAlexander\Desktop\200MiB.txt
Comparing files C:\USERS\GEOFFALEXANDER\DOCUMENTS\PYTHON\200MiB.txt and C:\USERS\GEOFFALEXANDER\DESKTOP\200MIB.TXT
FC: no differences encountered

Why does the copied file get a new size? How can two files with different sizes be identical? Is Windows 10 incorrectly reporting the size of the new file?

I'm running Windows 10 Enterprise Build 1809 (OS Build 17763.615) if that makes any difference.

It turns out the file size change wasn't due to the copying of the file. Rather the file size change occurred when checking in the file to RTC (Rational Team Concert). The RTC check in was converting existing LF line delimiters into CRLF line delimiters (Windows line delimiters). See RTC File content types and line delimiters for details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM