When I copy small files to harddisk, then there is more space needed than the total filesize.
How can i detect what real harddisk space is needed?
Mark
Printable View
When I copy small files to harddisk, then there is more space needed than the total filesize.
How can i detect what real harddisk space is needed?
Mark
GetDiskFreeSpace() gets information about the disk sizes. I think a file takes up a whole number of clusters, so you should find that bytes per sector * sectors per cluster gives you the minimum block size. Your files will take a multile of that size, I believe.
I know that GetDiskFreeSpace() is not what i need, thats why this question.
Question: how to get sector-, cluster- and blocksize from disk
Mark
Why do you say GetDiskFreeSpace() is not what you need? Have you looked up the function in the help? It gives sectors per cluster (= cluster size when multiplied by the next item), bytes per sector (= sector size), free clusters available and total number of clusters. Exactly what you are asking for. Blocksize is, as far as I know, one cluster.
Sorry,
i looked at the wrong function (GetDiskFreeSpaceEx()), my apologies for the misunderstanding.
Mark
Ah, yes. I forgot. We use VC++ V4.0 here, so that function isn't available. What does that return, out of interest?
BOOL GetDiskFreeSpaceEx(
LPCTSTR lpDirectoryName, // pointer to the directory name
PULARGE_INTEGER lpFreeBytesAvailableToCaller, // receives the number of bytes on
// disk available to the caller
PULARGE_INTEGER lpTotalNumberOfBytes, // receives the number of bytes on disk
PULARGE_INTEGER lpTotalNumberOfFreeBytes // receives the free bytes on disk
);