问题
I'm reading in my program some files from system32 folder; and one of these files (C:\Windows\System32\gdi32.dll) demonstrates a very strange behavior. When I'm reading it from my program, it shows size of 310'784 bytes; and when I view it's size from Explorer, it shows size of 404'480 bytes. How could that be?
回答1:
The most likely explanation is that your program is 32-bit and Explorer is 64-bit. When a 32-bit program opens files in C:\Windows\System32
(which contains 64-bit DLLs), it's actually redirected to C:\Windows\SysWOW64
(which contains 32-bit DLLs). The size difference you're seeing is the difference between the C:\Windows\SysWOW64\gdi32.dll
and C:\Windows\System32\gdi32.dll
files.
For more information, see KB article 896456.
来源:https://stackoverflow.com/questions/3099082/twofaced-file-problem