FlushFile Event

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


virtual int FireFlushFile(CBFSFlushFileEventParams *e);
typedef struct {
const char *FileName;
void *FileContext;
int ResultCode; int reserved; } CBFSFlushFileEventParams;
virtual INT FireFlushFile(CBFSFlushFileEventParams *e);
typedef struct {
LPVOID FileContext;
INT ResultCode; INT reserved; } CBFSFlushFileEventParams;


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