Re: [WIN] drive space used != total file space used; whynot?
- Posted by mistertrik at hotmail.com Feb 10, 2002
- 491 views
>I'm getting that ok (verified afterward by using "properties" on each >directory & comparing), but when I SUM UP all the space used by all >directories (& also all files on the drive which are not in >directories), >and compare that to what I see when I use "properties" >on the DRIVE >itself, the "properties" says there's more space used up >on the drive than >the summing of the directories says. > >So I'm wondering what I'm missing. >Anybody got any idea what might be going on? >Dan Cluster size? A 352 byte file will occupy 1 cluster on the disk, even though is smaller than that. The discrepancy you are seeing may be because of this. Each file needs to occupy a whole number of clusters, so if it uses part of a cluster, it 'spills over' and is seen to occupy all of it. (or something like that) Alternatively, use: usedSpace = diskSize - freeSpace() ===================================================== .______<-------------------\__ / _____<--------------------__|=== ||_ <-------------------/ \__| Mr Trick