ssCore.FileSys.getFreeSpace

Returns the amount of free space (in kilobytes) on the target drive.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

path - A fully qualified file path (drive letter or UNC path). This parameter supports monikers.


Output Parameters:

result - Free space, in Kilobytes.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.FileSys.getFreeSpace( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.FileSys.getFreeSpace( paramsObject );


Notes:

A failure with an error code of "8" doesn't necessarily mean the drive has no free space. It simply means that the amount of free space could not be determined.

One kilobyte is 1024 bytes.

To convert the value to megabytes, divide result by 1024. To convert to gigabytes, divide result by 1048576.

                

Examples:

var return_obj = ssCore.FileSys.getFreeSpace({path:"C:"});

ssDebug.trace(return_obj.result);