Ok, I'm now on a different machine (though still win XP/dev-Cpp setup), and I've done a few more tests. the code seems to run ok on C: but screws up on E and F (E is the system drive in this case)
here's the source
the code takes one argument, a string representing a list of drives to scan, eg
int main(int argc, char *argv)
printf("not a fixed drive, skipping");
printf("FREE :%u bytes\n",free);
and the output when run on this computer, with that command line:
FREE :56360960 bytes
FREE :1890611200 bytes
FREE :93036544 bytes
The free values for each drive are correct to an accuracy of a few mb, howevr something very weird is going on with the totals:
C is a 100mb FAT32 partition, which has turned out correct
E is the remaining partition on that drive, 37.1 Gb NTFS, system drive
F is a 16 Gb partition on a 20 Gb drive (FAT 32) the last 4 Gb of this drive is unaccssible to windows (Linux partition).
there's some pretty weird stuff going on there, but I don't really know enough about it to draw much of a conclusion.
I've read the posts from this forum ( and from some google searches) and I've seen nothing that would indicate this kindof behaviour.
thanks for the responses