getFreeSpace

getFreeSpace(freeSpace: Decimal output): Integer;

The getFreeSpace method of the DbFile class evaluates the total amount of free space in the physical database file and returns the amount as a Decimal value.

The getFreeSpace method returns the number of errors encountered, if any, while performing the evaluation operation.

You can execute the getFreeSpace method when one of the following conditions is true.

The following example shows the use of the getFreeSpace method.

vars
    dbFile : DbFile;
    free : Decimal[20,0];
begin
    foreach dbFile in DbFile.instances do
        if dbFile.name = "customer" then
            dbFile.changeAccessMode(DbFile.Mode_ReadOnly);
            dbFile.getFreeSpace(free);
            dbFile.changeAccessMode(DbFile.Mode_Update);
        endif;
    endforeach;
    write free;
end;

This method executes on a persistent server node, and is implemented and executed by the physical database engine. For details, see "Evaluating Free Space", in Chapter 3 of the JADE Database Administration Guide.

For details about the parameters that provide advanced diagnostic capabilities when performing certify and freespace evaluation operations, see "Database Diagnostics Section [DBUtil]", in the JADE Initialization File Reference.