Discuss this help topic in CBFS Forum

OnFlushFile event/delegate/callback


Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

CallbackFileSystem     See also    


This event is fired when the OS needs to flush the data of the open file or volume.


    property OnFlushFile : TCbFsFlushFileEvent;
    TCbFsFlushFileEvent = procedure( Sender : TObject; FileInfo: TCbFsFileInfo ) of object;

[C++ (Lib)]
    void (__stdcall *CbFsFlushFileEvent)(void* Sender, CbFsFileInfo* FileInfo );

[C++ (VCL)]
    typedef void (__closure *TCbFsFlushFileEvent)( System::TObject* Sender, TCbFsFileInfo* FileInfo );

[C++ (.NET)]
    public __delegate void CbFsFlushFileEvent( CallbackFileSystem^ Sender, CbFsFileInfo^ FileInfo );

    public void CbFsFlushFileEvent( CallbackFileSystem Sender, CbFsFileInfo FileInfo );

    Sub CbFsFlushFileEvent( ByVal Sender As CallbackFileSystem, ByVal FileInfo As CbFsFileInfo )

    void ICbFsFileEvents.onFlushFile( CallbackFileSystem sender, CbFsFileInfo fileInfo );


  • Sender - reference to the class that called the delegate/event handler
  • FileInfo - contains information about the file. Can be nil / NULL / null / Nothing


This event is fired when the OS tells the file system, that file buffers (incuding all possible metadata) must be flushed and written to the backend storage. FileInfo contains information about the file to be flushed. If FileInfo is empty, your code should attempt to flush everything, related to the disk.

Error handling

See Error handling topic for detailed information about how to report errors, which occur in the event handlers, back to Callback File System. Throwing ECBFSError exception from this event handler will not cause the OS to abort the operation or display an error message to the user.

See also


Discuss this help topic in CBFS Forum