Would GetDiskFreeSpace be the right call to
use to obtain the cluster size of a given HDD?
Thanks
Michael Ritter
use to obtain the cluster size of a given HDD?
Thanks
Michael Ritter
' Partition or FAT32 ' Logical Volume Cluster Size '-------------------------------- ' less than 512 meg (must use FAT16) ' 512 Meg to 8 Gig 4,096 ' 8 Gig to 16 Gig 8,192 ' 16 Gig to 32 Gig 16,384 ' Over 32 Gig ¿? 32,768 ' ' Max partition size is 2 terabytes in FAT32.
#Compile Exe #Register None #Dim All #Include "Win32Api.Inc" Function PbMain Dim SectorsPerCluster As Dword, BytesPerSector As Dword, _ NumberOfFreeClusters As Dword, TotalNumberOfClusters As Dword GetDiskFreeSpace "C:\", SectorsPerCluster, _ BytesPerSector, NumberOfFreeClusters, TotalNumberOfClusters MsgBox Str$(BytesperSector * SectorsPerCluster) AllocConsole Shell "chkdsk c:" Sleep 2000 FreeConsole End Function
Michael-- For reliable results, you use DeviceIOControl. Under 9x, you use DeviceIOControl with the old Get Drive Parameters call. Under NT/2K, it's simpler. You use DeviceIOControl with %IOCTL_DISK_GET_DRIVE_GEOMETRY. If all of this sounds rather cryptic, begin with studying DeviceIOControl. Accessing hardware, even the physical drives, is possible under Win32 but rarely simple. However, when identifying sector or cluster size, accessing hardware is also not appropriate. These geometries are a function of the OS, which supplies the information when queried.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment