Find total size of the hard disk

Discussion in 'C' started by ajeshjohn, Jun 21, 2006.

  1. ajeshjohn

    ajeshjohn New Member

    Joined:
    Jun 20, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Bangalore
    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
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
  3. ajeshjohn

    ajeshjohn New Member

    Joined:
    Jun 20, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Bangalore
    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
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Try using _getdiskfree function defined in dos.h which populates the structure _diskfree_t
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice