CBFS Connect 2020 Delphi Edition

Questions / Feedback?

FlushFile Event

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

Syntax

type TFlushFileEvent = procedure (
  Sender: TObject;
  const FileName: String;
  FileContext: Pointer;
  var ResultCode: Integer
) of Object;

property OnFlushFile: TFlushFileEvent read FOnFlushFile write FOnFlushFile;

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) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS Connect 2020 Delphi Edition - Version 20.0 [Build 8348]