I want to compare a filesize to check if it is below 8GB. How could I convert either the filseSize( which is in DWORD) to GB or the 8 GB to DWORD?
Thank you!
I want to compare a filesize to check if it is below 8GB. How could I convert either the filseSize( which is in DWORD) to GB or the 8 GB to DWORD?
Thank you!
Copyright © 2021 Jogjafile Inc.
I'm guessing from your
DWORDhint, you are on the Windows platform and using Win32 APIs to get file sizes.Don't call GetFileSize. It's limited to a DWORD (32-bit), which I think it what your question is about.
Instead, invoke GetFileSizeEx, which gives you back a 64-bit result for a file handle. Or GetFileAttributesEx which gives back a struct with a 64-bit size in it split across two dwords.
Example:
OR