Solid File System

Virtual file system enigne that can be embedded into your software.

SolFSStorage.Compact method


Pascal    Plain C    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

SolFSStorage     See also    


Compacts the file, in which the storage is located.


    function Compact: Boolean;

[Plain C]
    long _stdcall StorageCompact(unsigned long Storage, char *Compacted);

[C++ (DLL/Lib)]
    bool Compact();

[C++ (VCL)]
    bool __fastcall Compact();

[C++ (.NET)]
    bool Compact();

    public bool Compact();

    Public Function Compact as Boolean

    boolean compact();


  • [Plain C] Storage - handle to the storage returned by Create or Open function.
  • [Plain C] Compacted - returns 1 on success,
    0 if storage is busy with another process.

Return value

    True on success.
    False if storage is busy with another process.

[Plain C]     0 if the function succeeded or one of Error codes if the function failed.


Use Compact method to decrease size of the back-end container (file on the disk or other container), in which the storage is located. Compacting is done by reordering pages in the file and then truncating the file (and removing extra space).

See also

AutoCompact     DiskSize     DiskFree    

Back to top