BBS: Inland Empire Archive
Date: 02-27-93 (13:47)             Number: 315
From: DOUG JAMES                   Refer#: NONE
  To: MARK WITTKOSKI                Recvd: NO  
Subj: Help!                          Conf: (2) Quik_Bas
 MW> Still looking for a way to read the dos directly, so I
 MW> can check the filename of each file. Also am interested
 MW> in know how to check the disk to see how much disk
 MW> space is available on the disk. Any help is appreciated!

Here's a quickie for ya....

'routine to demonstrate finding drive space
'* WARNING:                                      *
'* This program has NO error checking! If you    *
'* attempt to access a floppy with no disk, this *
'* mutha will CRASH AND BURN!                    *
'*                                               *
'* Also, you will need to load QB.QLB when you   *
'* run this from the interpreter                 *
' we need to include register and interrupt defs

' Define the type needed for Interrupt
TYPE RegType
     ax    AS INTEGER
     bx    AS INTEGER
     cx    AS INTEGER
     dx    AS INTEGER
     bp    AS INTEGER
     si    AS INTEGER
     di    AS INTEGER
     flags AS INTEGER

DECLARE SUB Interrupt (intnum AS INTEGER, inreg AS RegType, outreg AS RegType

DIM inreg AS RegType, outreg AS RegType

'define our potential drives

' we know we're looking for free disk space, so we'll preset the
' values here. = &H3600
intnum = &H21

' ok... let's do our thang
BEEP: PRINT "What drive do you want to check? -> ";
response$ = UCASE$(INPUT$(1)): PRINT response$

inreg.dx = INSTR(Drives$, response$)

CALL Interrupt(intnum, inreg, outreg)

'print the results
PRINT : PRINT " Information for Drive "; response$; ": "
PRINT : PRINT "Sectors per cluster: ";
PRINT "Bytes per sector: ";
PRINT "Total clusters: "; outreg.dx
PRINT "Number of available clusters: "; outreg.bx

--- Maximus 2.01wb
 * Origin: No Baudy does it better! *804-744-9260* (1:264/211)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET