(Win32) Filesystem allocation page size?
In Win32 is there a way to determine the size of an allocation page on a filesystem? I'm writing a function to truncate a file from the current position by changing the EOF value. I want to also free any allocation pages no longer used after this is done, but I have to know the size of an allocation page to accomplish this. I know that typically the allocation pages on an NTFS filesystem are 4 KB, but I can't depend on that value, as I want to be able to use this code on any PC with Windows. Any help is appreciated.
To determine cluster size, use GetDiskFreeSpace. Note however that the FS is responsible for trimming away unneeded clusters when you SetEndOfFile.
HTH+HAND
HTH+HAND
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement