Discuss this help topic in CBFS Forum

CallbackFileSystem.ReleaseUnusedFiles method


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

CallbackFileSystem     See also    


Tells the OS to release the files, kept open by cache manager


    function ReleaseUnusedFiles : boolean;

[C++ (Lib)]
    bool ReleaseUnusedFiles();

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

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

    bool ReleaseUnusedFiles();

    Function ReleaseUnusedFiles() As Boolean

    boolean releaseUnusedFiles();

Return values

True if the files were released successfully and False otherwise.


Use ReleaseUnusedFiles to tell the OS to release the files that it might have kept as open for cache manager. This method can be used when you track use of the virtual file system and need to perform some operations, when the file system is not used.

While you call this method, it's possible for the OS to open more files. So you need to guard the call using some critical secion or other synchronization object. Use the same object in OnOpen callback handlers. This way you will ensure that after calling ReleaseUnusedFiles there are no files, kept opened by cache manager.

Call from...

This method may be called from callback / event handlers or from outside of callback / event handlers.

When you call the method from callback, it's scheduled for asynchronous execution in another thread. The call returns immediately and ERROR_IO_PENDING error code is reported after the call.

Discuss this help topic in CBFS Forum