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 file is read-only
-
The database is open with update usage; however, if the database mode is not exclusive and is not archive, the file access mode must be read-only
-
The database is in archive mode (quiesced mode)
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 "
For details about the parameters that provide advanced diagnostic capabilities when performing certify and freespace evaluation operations, see "