updating oE db_compress


include eds.e 
namespace eds 
public function db_compress() 

compresses the current database.


An integer, either DB_OK on success or an error code on failure.


The current database is copied to a new file such that any blocks of unused space are eliminated. If successful, the return value will be set to DB_OK, and the new compressed database file will retain the same name. The current table will be undefined. As a backup, the original, uncompressed file will be renamed with an extension of .t0 (or .t1, .t2, ..., .t99). In the highly unusual case that the compression is unsuccessful, the database will be left unchanged, and no backup will be made.

When you delete items from a database, you create blocks of free space within the database file. The system keeps track of these blocks and tries to use them for storing new data that you insert. db_compress will copy the current database without copying these free areas. The size of the database file may therefore be reduced. If the backup filenames reach .t99 you will have to delete some of them.

Example 1:
if db_compress() != DB_OK then 
    puts(2, "compress failed!\n") 
end if 
Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu