CBFS Filter 2020 Node.js Edition

Questions / Feedback?

CleanupContext Event

Fires when the application-defined data stored in one or more contexts needs to be cleaned up.


cbfilter.on('CleanupContext', [callback])


The 'callback' is called when the 'CleanupContext' event is emited.

function(e){ }

The argument 'e' has the following properties:



This event fires after a file or directory is closed, just before any contexts related to it are discarded, giving applications a chance to clean up any information stored in them.

The FileContext and HandleContext parameters are placeholders for application-defined data associated with the file and specific handle, respectively. Please refer to the Contexts topic for more information.

When a handle to some file or directory is closed, this event will fire if the HandleContext associated with that handle is not . When the last handle to the file or directory is closed, this event will fire if the HandleContext associated with that handle and/or the FileContext associated with that file or directory is not . After this event fires, the applicable contexts are set back to automatically.

Applications that need to know the name of the file or directory this event is firing for should store a copy of said name in the context itself during an earlier event.

This event is optional; it will fire regardless of whether any filter rules are present, but only if FileContext, HandleContext, or both, are not already . Applications that clean up their contexts (and set them back to ) when a file is being closed, or earlier, do not need to handle this event.

The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a non-zero value to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.

This event is fired synchronously; please refer to the Event Types topic for more information.

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