Click or drag to resize

DiskSpace Function (String)

X#
Return the capacity of the specified disk.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 FUNCTION DiskSpace(
	cDrive AS STRING
) AS INT64
Request Example View Source

Parameters

cDrive
Type: String
The name of the drive as a string, for example "C:", "A:". If you do not specify a drive, the Windows default is used.

Return Value

Type: Int64
The capacity of the specified disk drive in bytes.
Remarks
DiskSpace() determines the capacity of the specified disk drive in bytes. This function is only accurate for disk drives up to 2 gigabytes in size.
For larger drives, please refer to the GetDiskFreeSpaceEx() Windows API function.
Examples
This example displays the capacity of the C drive in a TextBox:
X#
1TextBox{, "C Drive Capacity", AsString( DiskSpace(3) ) }:Show()
2TextBox{, "C Drive Capacity", AsString( DiskSpace("C:") ) }:Show()
See Also