Rapid-Q Documentation by Alain Besseleer (c)2009 Appendix D: QVolumeInfo


QVolumeInfo Component

QVolumeInfo is a non visible component to retrieve information about a volume (drive). This is a custom component: include "QVolumeInfo.inc" to make it available.

QVolumeInfo Properties
FieldTypeRead/WriteDefault ValueSupport





Serial STRING R W
Serial given to volume during creation of partitions
Name STRING R W
FileSystem STRING R W
NTFS, FAT32 etc...
DriveRoot STRING R W
Bytes LONG R W
Number of bytes / sector
Sectors LONG R W
Number of sectors / cluster
TotalClusters LONG R W
Total number of cluster on volume
FreeClusters LONG R W
TotalBytes DOUBLE R W
FreeBytes DOUBLE R W
TotalSpace STRING R W
Short string representation of total space on volume
FreeSpace STRING R W
Short string representation of free space on volume
DriveType LONG R W
DriveTypeString STRING R Empty W
String representation of drivetype
DriveTypeUnknown INTEGER R Empty W
0 if drivetype is known, 1 if drivetype is unknown


QVolumeInfo Methods
MethodTypeDescriptionParamsSupport





SelectDrive SUB(DriveRoot as string) Select a drive 0 W
Call this first before retrieving a volumes properties
GetStringFormat SUB(NumberOfBytes as double) Shows the QAboutForm 0 W
Returns a short string representation:
.GetStringFormat(50000) = 48.8 KB
.GetStringFormat(8000000) = 7.6 MB
.GetStringFormat(100000000000) = 93.1 GB etc...


QVolumeInfo Examples
$Include "QVolumeInfo.inc"

dim VolumeInfo as QVolumeInfo
    VolumeInfo.SelectDrive("c:")
    
showmessage "The Serial of drive " + VolumeInfo.DriveRoot + " = " + VolumeInfo.serial
showmessage "Total size: " + VolumeInfo.TotalSpace + chr$(10) + "Free: " + VolumeInfo.FreeSpace
showmessage "Drivetype = " + VolumeInfo.drivetypestring + chr$(10) + "Drivetype = " + str$(VolumeInfo.drivetype)
showmessage "FileSytem = " + VolumeInfo.FileSytem