Find total size of the hard disk

Newbie Member
21Jun2006,11:52   #1
ajeshjohn's Avatar
Hi,
Can anyone please tell me how to find the total hard disk size using C in DOS environment. The hard disk might not be formatted.

Thanks for the help...
Aju
Go4Expert Founder
21Jun2006,15:45   #2
shabbir's Avatar
Try using GetDiskFreeSpaceEx
Newbie Member
22Jun2006,09:53   #3
ajeshjohn's Avatar
Thanks for the reply Shabbir,

But the function that you have told is a win32 API, right?
That will not work in DOS mode. I mean in DOS OS.
I was looking for something that will work under DOS mode, some solution in C or even in assembly language.

Thanks
Go4Expert Founder
23Jun2006,13:16   #4
shabbir's Avatar
Try using _getdiskfree function defined in dos.h which populates the structure _diskfree_t