Software
Java
JavaScript
Delphi
HomeDelphi

Finding The Default Drive Size

Click to select the code.  Use Control-C to copy it to your clipboard. Help

Comments

The size of the default drive can be found with the DiskSize function.  This is part of SysUtils, which should be declared in your uses clause.  The value returned is in bytes.

You can also get the size of other drives.  DiskSize(0) returns the default drive size; but [usually] DiskFree(1) would return the size of drive A:. DiskSize(2) for B:, DiskSize(3) for C:, and so on.  Caution with this, though, as not all systems are configured the same way in hardware.  DiskSize will return -1 if a drive is unavailable (for example, no diskette in the A: drive).

.

Copyright 2001 - 2012 by CodeFoot.com and OECCorp.
The 2012 Evolution™


LegalPrivacyCodeFoot.com is an OEC InterNET Group site.SupportNotices
CodeBrain.com BrainCode.com CodeFoot.com CodeBelly.com CodeLifter.com
PopUpWorks.com Droiddd.com etLux.com OECCorp.com
TrayApps.com DavidSosnowski.com MicroTicker.com