Sys_GetFreeDiskSpace
Description
Section titled “Description”Gets the free disk space on a drive, and checks it against the space the package requires.
Syntax
Section titled “Syntax”Sys_GetFreeDiskSpace(sDrive, iRequired) As Boolean
Parameters
Section titled “Parameters”sDrive (String)
Section titled “sDrive (String)”Drive to check, for example C:\. You can also use a path on the drive.
iRequired (Integer)
Section titled “iRequired (Integer)”Required free space in megabytes (MB)
Return value
Section titled “Return value”If there’s enough free space, the free space in MB is stored in giValue, and gbSuficientDiskSpace is set to True.
If the free space is less than iRequired, the function writes this to the package log, sets the package status to Not Compliant (see CMS_SetPackageStatusToNotCompliant), and returns False. giValue isn’t updated in this case.
The function also returns False if the drive doesn’t exist.
Example
Section titled “Example”If bStatus Then bStatus = Sys_GetFreeDiskSpace ("C:\", 10)If bStatus Then bStatus = Job_Writelog("Custom", "giValue: " & giValue, bStatus, True)Related functions
Section titled “Related functions”Sys_GetFileSystemType Sys_GetDriveType Constants Package Property Variables