www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/14/14:57:57

Date: Sun, 14 Sep 1997 17:57:55 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Deltaman <deltaman AT swipnet DOT se>
cc: djgpp AT delorie DOT com
Subject: Re: Check how large the hard-drive is
In-Reply-To: <34196B99.407F@swipnet.se>
Message-ID: <Pine.SUN.3.91.970914175727.20228C-100000@is>
MIME-Version: 1.0

On Fri, 12 Sep 1997, Deltaman wrote:

> Are there any ways to see how much _total_ diskspace a harddrive has
> (both free and used)? I found a function that can tell how much _free_
> diskspace is available (getdfree), but it is not what I wanted.

It seems that you have missed the docs.  The documentation of
`getdfree' clearly tells that you get both free and total space:


     void getdfree(unsigned char drive, struct dfree *ptr);

Description
-----------

This function gets information about the size and fullness of the given
drive (0=default, 1=A:, etc).  The return structure is as follows:

     struct dfree {
       unsigned df_avail; /* number of available clusters */
       unsigned df_total; /* total number of clusters */
       unsigned df_bsec;  /* bytes per sector */
       unsigned df_sclus; /* sectors per cluster */
     };

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019