1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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,285
    Likes Received:
    364
    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,285
    Likes Received:
    364
    Trophy Points:
    83
    Try using _getdiskfree function defined in dos.h which populates the structure _diskfree_t
     

Share This Page