•  Back 
  •  GEMDOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FileDfree()                                                              GEMDOS

Syntax

LONG Dfree( buf, drive )
DISKINFO *buf;
WORD drive;

Function      Dfree() returns information regarding the storage
              capacity/current usage of the specified drive.

Opcode        54 (0x36)

Availability  All GEMDOS versions.

Parameters    buf is a DISKINFO pointer which will be filled in on
              function exit. DISKINFO is defined as:

              typedef struct
              {
               /* No. of Free Clusters */
               ULONG b_free;

               /* Clusters per Drive */
               ULONG b_total;

               /* Bytes per Sector */
               ULONG b_secsize;

               /* Sectors per Cluster */
               ULONG b_clsize;
              } DISKINFO;

              drive is a WORD which indicates the drive to perform the
              operation on. A value of DEFAULT_DRIVE (0) indicates the
              current GEMDOS drive. A value of 1 indicates drive 'A:',
              a 2 indicates 'B:', etc...

Binding       move.w   drive,-(sp)
              pea      buf
              move.w   #$36,-(sp)
              trap     #1
              addq.l   #8,sp

Return Value  Upon return, a value of 0 indicates success. Otherwise,
              a negative GEMDOS error code is returned.

Caveats       Prior to GEMDOS version 0.15 this function is very slow when
              used on a hard disk.

Comments      To obtain the free number of bytes on a disk, use the
              formula (info.b_free * info.b_secsize * info.b_clsize). To
              obtain the total number of bytes available on a disk, use
              the formula (info.b_total * info.b_secsize * info.b_clsize).