CBFS Connect 2020 Python Edition

Questions / Feedback?

on_flush_file Event

Fires when the OS needs to flush an open file's data out to storage.

Syntax

class CBFSFlushFileEventParams(object):
  @property
  def file_name() -> str: ...
  @property
  def file_context() -> int: ...
  @property
  def result_code() -> int: ...
  @result_code.setter
  def result_code(value) -> None: ...

# In class CBFS:
@property
def on_flush_file() -> Callable[[CBFSFlushFileEventParams], None]: ...
@on_flush_file.setter
def on_flush_file(event_hook: Callable[[CBFSFlushFileEventParams], None]) -> None: ...

Remarks

This event fires anytime the OS needs the virtual filesystem to flush data out to storage. If the FileName parameter is non-empty, then all data related to the specified file (i.e., contents and all metadata) should be flushed. If FileName is empty, everything related to the virtual drive should be flushed.

To handle this event properly, applications must flush the requested data, writing it out to their backend storage.

The FileContext parameter is a placeholder for application-defined data associated with the file. Please refer to the Contexts topic for more information. (Not applicable if FileName is empty.)

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.

 
 
Copyright (c) 2021 Callback Technologies, Inc. - All rights reserved.
CBFS Connect 2020 Python Edition - Version 20.0 [Build 7880]