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.