FreeSpace Property

Applies to TestComplete 14.40, last modified on April 22, 2021

Description

Use the FreeSpace property to determine the amount of free space available on the specified drive.

Declaration

aqDriveInfoObjObj.FreeSpace

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

Applies To

The property is applied to the following object:

Property Value

The amount of free space (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
TotalSize Property

Highlight search results