FlushFile Event
Fires when the OS needs to flush an open file's data out to storage.
Syntax
ANSI (Cross Platform) virtual int FireFlushFile(CBFSFlushFileEventParams *e);
typedef struct {
const char *FileName;
void *FileContext;
int ResultCode; int reserved; } CBFSFlushFileEventParams; Unicode (Windows) virtual INT FireFlushFile(CBFSFlushFileEventParams *e);
typedef struct {
LPCWSTR FileName;
LPVOID FileContext;
INT ResultCode; INT reserved; } CBFSFlushFileEventParams;
#define EID_CBFS_FLUSHFILE 17 virtual INT CBFSCONNECT_CALL FireFlushFile(LPWSTR &lpszFileName, LPVOID &lpFileContext, INT &iResultCode);
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.