CBFS Connect 2020 Node.js Edition

Questions / Feedback?

ReleaseUnusedFiles Method

Instructs the OS to release any files kept open by the cache manager.

Syntax

cbfs.releaseUnusedFiles([callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method instructs the OS to release any files that the system cache manager has kept open, and returns either true or false to indicate whether the files were released successfully. Having the OS release open files can be useful in situations where operations need to be performed while the filesystem is not in use.

Please note that the OS may open additional files during the execution of this method. To guard against this, it is recommended that application use a critical section (or other synchronization object) when calling this method, and use the same one in the OpenFile event handler. Such an approach ensures that the cache manager has no files open after calling this method.

Note: This method can only be called when Active is true. It may be called both within and outside of events; when called within an event, it is executed asynchronously on another thread (causing the call to return immediately, and an ERROR_IO_PENDING result code to be reported to the OS).

Copyright (c) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS Connect 2020 Node.js Edition - Version 20.0 [Build 8164]