Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Correct cluster size
Message
De
20/08/2001 09:21:47
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00546141
Message ID:
00546159
Vues:
15
>>How do I get the correct cluster size for a disk?
>>
>>The built-in command in VFP, sys(2022), always returns 32KB for networked drives, but also for FAT32 drives, even if they are local.
>>
>>Hilmar.
>
>The GetDiskFreeSpace() API call used to correctly return this information. However, with the advent of disks greater than 2 gb, it is not reliable since it caps the amount of space at 2 gb, adjusting the values returned accordingly. In short, this sort of information cannot be reliably returned even from the API.

No, no, 'tis not the free space I want, but the cluster size.

I wrote a small utility, which I called "Who's gobbling my hard disk", that totals file sizes for each folder. For accurate information, for a specific disk, I need the cluster size. For instance, on my current "C:" drive, a 100-byte batch-file actually uses 4 KB, because that is the cluster size I am using.

Since sys(2022) isn't trustworthy (see my original message), I gave the user the option of selecting the cluster size.

This I will do anyway, even if I find out how to get the cluster size: it may be useful to know how much space would be used somewhere else. For instance, if I copy files to a ZIP disk (cluster size: 2 KB, I believe).

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform