CBFS Filter 2020 Node.js Edition

Questions / Feedback?

SuspendFileEvents Method

Suspends all events for a particular file or directory until all of its handles have been closed.

Syntax

cbfilter.suspendFileEvents([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){ }

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

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

Applications can call this method from an AfterCreateFile or AfterOpenFile event to suspend all further events for the file or directory that the event fired for. The suspension will remain in effect until all handles to said file or directory have been closed, at which point the class will once again fire events for it (if it is accessed again).

Typically, this method should only be used as a "last resort"; that is, when the application cannot achieve the same outcome through the use of more granular standard filter rules. Said another way, it is almost always more efficient for an application to exclude files and/or directories implicitly using standard filter rules, if possible, than it is to exclude them explicitly using this method.

Note: This method can only be called within the AfterCreateFile and AfterOpenFile events

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