Previous Topic: GetDiskSize, GetDiskSizeB, GetDiskSizeKB, and GetDiskSizeMB - Return the Disk SizeNext Topic: GetDrive - Return the Current Drive Number


GetDiskUsage, GetDiskUsageB, GetDiskUsageKB, and GetDiskUsageMB - Return the Amount of Disk Usage

Valid on Symbian OS, Windows, and Windows CE

The GetDiskUsage and the GetDiskUsageKB functions return the amount of disk usage in KB, the GetDiskUsageB function returns the amount of disk usage in bytes, and the GetDiskUsageMB function returns the amount of disk usage in MB.

Function format:

GetDiskUsage(drivenumb1 as Integer) as Integer
GetDiskUsageB(drivenumb1 as Integer) as Integer
GetDiskUsageKB(drivenumb1 as Integer) as Integer
GetDiskUsageMB(drivenumb1 as Integer) as Integer
drivenumb1

Indicates the drive number.

The functions return the size in a 32-bit integer format. Large disks may exceed the capacity, resulting in wrong sizes or negative values due to truncation.

The drive is indicated by the drivenumb1 parameter, which specifies a drive number: 0 for the default, 1 for A, 2 for B, and so on.

Each function returns an integer, which is the disk usage, as follows:

GetDiskUsage

Indicates the disk usage value in KB.

GetDiskUsageB

Indicates the disk usage value in bytes.

GetDiskUsageKB

Indicates the disk usage value in KB.

GetDiskUsageMB

Indicates the disk usage value in MB.

Note: Use the GetFileStore function instead as it is portable.

Example:

Dim drive AS Integer
drive = GetDrive()
Print("Current drive is  : " + Str( drive ))
Print("Current drive Size : " + Str( GetDiskSizeMB( drive )) + " MB"))
Print("Current drive Free : " + Str( GetDiskFreeMB( drive )) +