TotalSize Property

Applies to TestComplete 15.0, last modified on October 22, 2021

Description

Use the TotalSize property to determine the capacity of the specified drive.

Declaration

aqDriveInfoObj.TotalSize

Read-Only Property Double
aqDriveInfoObj An expression, variable or parameter that specifies a reference to an aqDriveInfo object

Applies To

The property is applied to the following object:

Property Value

The total size in bytes.

Example

The following example demonstrates how you can get the total size and free space of the desired drive.

JavaScript, JScript

function DriveSizeExample()
{
  Log.Message(aqFileSystem.GetDriveInfo("C").TotalSize);
  Log.Message(aqFileSystem.GetDriveInfo("C").FreeSpace);
}

Python

def DriveSizeExample():
  Log.Message(aqFileSystem.GetDriveInfo("C").TotalSize)
  Log.Message(aqFileSystem.GetDriveInfo("C").FreeSpace)

VBScript

Sub DriveSizeExample
  Call Log.Message(aqFileSystem.GetDriveInfo("C").TotalSize)
  Call Log.Message(aqFileSystem.GetDriveInfo("C").FreeSpace)
End Sub

DelphiScript

function DriveSizeExample;
begin
  Log.Message(aqFileSystem.GetDriveInfo('C').TotalSize);
  Log.Message(aqFileSystem.GetDriveInfo('C').FreeSpace);
end;

C++Script, C#Script

function DriveSizeExample()
{
  Log["Message"](aqFileSystem["GetDriveInfo"]("C")["TotalSize"]);
  Log["Message"](aqFileSystem["GetDriveInfo"]("C")["FreeSpace"]);
}

See Also

Working With Files From Scripts
GetDriveInfo Method
FreeSpace Property

Highlight search results