Hitachi

JP1 Version 11 JP1/Script Description and Reference (For Windows Systems)


8.5.32 GetDiskFreeSpace (get the disk free space)

Purpose

Gets the amount of free space on a disk.

Syntax
GetDiskFreeSpace (DiskName [, UnitofByte])
Arguments
DiskName

Specify the disk volume as a character string or as a variable that stores this value. You can omit the colon (:).

UnitofByte

Specify the units in which to acquire the free space as one of the following values:

Value

Meaning

KB

Kilobytes

MB

Megabytes

The returned free space size is rounded down. For example, if you specify MB and the file size is less than 1 megabyte, the command returns zero.

This value is optional. If you omit this value, KB is assumed.

Description

The GetDiskFreeSpace command calculates the free space on the specified disk and returns this value as the execution result.

Zero is returned if an error occurs.

Example
Dim MBsize, Bsize
MBsize = GetDiskFreeSpace ("A:", MB)
Bsize = MBsize * 1024 *1024
MessageBox ("Floppy disk capacity is" +Bsize +"bytes.")
JP1/Script version

Supported from JP1/Script 05-10.