Tells the OS to release the files, kept open by cache manager
function ReleaseUnusedFiles : boolean;
bool __fastcall ReleaseUnusedFiles();
Function ReleaseUnusedFiles() As Boolean
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.
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.