CBFS Filter 2020 Node.js Edition

Questions / Feedback?

FileFlushingBehavior Property

The file flushing and closing behavior that the class's system driver should enforce.

Syntax

 cbfilter.getFileFlushingBehavior([callback])
 cbfilter.setFileFlushingBehavior( fileFlushingBehavior, [callback])

Default Value

0

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 the getFileFlushingBehavior([callback]) 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.

The callback for the setFileFlushingBehavior([callback]) 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

This property specifies what file flushing and/or closing behaviors the class's system driver should enforce.

Applications that modify file data as it is being read and/or written may need to change this property's value in order to function correctly. For example, applications that provide on-the-fly encryption should choose the proper flags to ensure that other applications, which have opened the files being encrypted, can't accidentally write non-encrypted data to the disk.

Applications that do not modify file data as it is being read and/or written can leave this property unchanged.

The value of this property should be constructed by OR'ing together zero or more of the following flags:

FS_FLUSH_FILES_ON_OPEN1Whether memory-mapped file data should be flushed to disk before files are opened.

This flag indicates that the class's system driver should flush any cached and memory-mapped file data, leftover from the last time a file was opened, prior to opening it again. Doing so ensures that file data is read directly from the disk rather than from the old memory mapping.

Applications that modify file data as it is being read may need to set this flag in order to function correctly. For example, applications that provide on-the-fly encryption should set this flag to ensure that file data is always read from the disk (and thus has a chance to get decrypted) when a file is opened.

Applications that do not modify file data as it is being read should leave this flag unset in order to maintain optimal performance when opening files.

FS_FLUSH_FILES_ON_CLOSE2Whether file buffers must be flushed when files are closed.

This flag indicates that the class's system driver should flush and clear the buffers of files that are opened for writing (and have had data written to them) when they are closed.

Applications that modify file data as it is being written may need to set this flag in order to function correctly. For example, applications that provide on-the-fly encryption should set this flag to ensure that all file data is flushed to the disk (and thus has a chance to get encrypted) when a file is closed.

Applications that do not modify file data as it is being written can unset this flag.

After a file is flushed, all in-memory buffers and memory mappings are cleared to avoid leakage of unprotected information.

FS_CLOSE_FILES_ON_STOPFILTER4Whether files opened for writing must be closed when the application stops filtering.

This flag indicates that the class's system driver should close files that are opened for writing (and have had data written to them) when the application calls StopFilter.

Applications that modify file data as it is being written (e.g., on-the-fly encryption) may need to set this flag in order to prevent further operations against the file data from being performed. Applications that do not modify file data as it is being written can leave this flag unset.

Note that if memory mappings of some file exist, these mappings will remain active; only the open handles to such files are closed.

When the file is closed, all in-memory buffers and memory mappings are cleared to avoid leakage of unprotected information. Applications can control whether file data is flushed before files are closed using the FS_FLUSH_FILES_ON_STOPFILTER flag; any data that is not flushed gets discarded.

FS_FLUSH_FILES_ON_STOPFILTER8Whether file buffers must be flushed when the application stops filtering.

This flag indicates that the class's system driver should flush and clear the buffers of files that are opened for writing (and have had data written to them) when the application calls StopFilter.

Applications that modify file data as it is being written (e.g., on-the-fly encryption) may need to set this flag to ensure that no unprotected data is kept in memory, but rather has a chance to be encrypted and written out to disk. Applications that do not modify file data as it is being written can leave this flag unset.

If the application will not be able to perform on-the-fly data modification at the moment when StopFilter is called (e.g., because a cryptographic hardware module is unplugged), then this flag should be unset before calling StopFilter.

After a file is flushed, all in-memory buffers and memory mappings are cleared to avoid leakage of unprotected information.

FS_CLOSE_FILES_ON_CRASH16Whether files opened for writing must be closed if the application terminates unexpectedly.

This flag indicates that the class's system driver should close files that are opened for writing (and have had data written to them) if the driver detects that the application has terminated.

Applications that modify file data as it is being written (e.g., on-the-fly encryption) may need to set this flag in order to prevent further operations against the file data from being performed. Applications that do not modify file data as it is being written can leave this flag unset.

Note that if memory mappings of some file exist, these mappings will remain active; only the open handles to such files are closed.

When the file is closed, all in-memory buffers and memory mappings are cleared to avoid leakage of unprotected information.

FS_FLUSH_FILES_ON_CRASH32Whether file buffers must be flushed if the application terminates unexpectedly.

This flag indicates that the class's system driver should flush and clear the buffers of files that are opened for writing (and have had data written to them) if the driver detects that the application has terminated.

Applications that do not modify data as it is being written may set this flag if necessary. Applications that modify data as it is being written (e.g., on-the-fly encryption) should not set this flag, since such flushing could cause unprotected data to be written out to disk.

FS_SUPPORT_FILE_ENCRYPTION31Combination of flags suitable for on-the-fly file encryption applications.

This option includes the following flags: FS_FLUSH_FILES_ON_OPEN, FS_FLUSH_FILES_ON_CLOSE, FS_CLOSE_FILES_ON_STOPFILTER, FS_FLUSH_FILES_ON_STOPFILTER, and FS_CLOSE_FILES_ON_CRASH flags.

Data Type

Integer

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