Size Property

Applies to TestComplete 15.45, last modified on December 01, 2022

Description

The Size property indicates the total size occupied by all the files and subfolders of the given folder.

Declaration

aqFolderInfoObjObj.Size

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

Applies To

The property is applied to the following object:

Property Value

The folder’s size in bytes.

Example

The code below obtains the size of the C:\MyFiles folder and then posts this size to the test log.

JavaScript, JScript

function FolderSizeExample()
{

   // Obtains information about the folder
   var FolInfo = aqFileSystem.GetFolderInfo("C:\\MyFiles");
   
   // Obtains the folder's size
   var fSize = FolInfo.Size;
   
   // Posts this size to the test log
   Log.Message("The folder's size is: " + fSize);
   
}

Python

def FolderSizeExample():
  # Obtains information about the folder
  FolInfo = aqFileSystem.GetFolderInfo("C:\\MyFiles")
  # Obtains the folder's size 
  fSize = FolInfo.Size
  # Posts this size to the test log
  Log.Message("The folder's size is: " + str(fSize))

VBScript

Sub FolderSizeExample

   ' Obtains information about the folder
   Set FolInfo = aqFileSystem.GetFolderInfo("C:\MyFiles")
   
   ' Obtains the folder's size
   fSize = FolInfo.Size
   
   ' Posts this size to the test log
   Log.Message("The folder's size is: " & fSize)
   
End Sub

DelphiScript

function FolderSizeExample;
var FolInfo, fSize;
begin

   // Obtains information about the folder
   FolInfo := aqFileSystem.GetFolderInfo('C:\MyFiles');
   
   // Obtains the folder's size
   fSize := IntToStr(FolInfo.Size);
   
   // Posts this size to the test log
   Log.Message('The folder''s size is: ' + fSize);
   
end;

C++Script, C#Script

function FolderSizeExample()
{

   // Obtains information about the folder
   var FolInfo = aqFileSystem["GetFolderInfo"]( "C:\\MyFiles" );
   
   // Obtains the folder's size
   var fSize = FolInfo["Size"];
   
   // Posts this size to the test log
   Log["Message"]( "The folder's size is: " + fSize );
   
}

See Also

Working With Files From Scripts
GetFolderInfo Method
Name Property
Path Property

Highlight search results