Discuss this help topic in CBFS Forum

OnFlushFile event/delegate/callback

Filter:

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

CallbackFileSystem     See also    

Overview

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

Declaration

[Pascal]
    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 );

[C#]
    public void CbFsFlushFileEvent( CallbackFileSystem Sender, CbFsFileInfo FileInfo );

[VB.NET]
    Sub CbFsFlushFileEvent( ByVal Sender As CallbackFileSystem, ByVal FileInfo As CbFsFileInfo )

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

Parameters

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

Description

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

OnWriteFile    

Discuss this help topic in CBFS Forum