getting the disk size

Started by
2 comments, last by BungoMan85 20 years, 9 months ago
whats the easiest, quickest, and hopefuly simplist way to get the size of a disk? preferbly ANY disk, floppy, cd, or HDD. getting free/used space isnt so much an issue, i just need to know the total size (in c++ for MS vs 6.0). thanks in advance Bungo!
Bungo!
Advertisement
I don't know how, I don't use it very much , but I know what's the libary u must search it, it coulb be in stdlib.h or dir.h, try google and u probabbly will find that.

Sorry but it was the best I can do for u, I just had used it one time before :
any doubt let me know.



Rodrigo Dietze

[edited by - Dietze on July 7, 2003 7:39:47 AM]
Rodrigo Dietze
Under Win32, use the GetDiskFreeSpace function, which, additionnaly to the free space, gives you the total number of clusters on the drive , the number of sectors per cluster and the number of bytes per sector. Multiply all of them and you get the drive size. Just make sure you use a 64 bit integer since nowadays hard drive are bigger than 4 Gb.

And it''s not limited to HDD only, it should work with any disk (including floppy and CD/DVD).
sweet, thanks man

Bungo!
Bungo!

This topic is closed to new replies.

Advertisement