CallbackFilter

Instant control over file and folder operations in Windows and .NET applications

OnSetAllocationSizeN event/delegate/notification

Filter:

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

CallbackFilter     See also    

Overview

This notification callback is called when the OS or the application needs to set the allocation size of the file.

Declaration

[Pascal]
    property OnOnSetAllocationSizeN : TCbFltSetAllocationSizeEventN;
    TCbFltSetAllocationSizeEventN = procedure( Sender : TObject; FileName: TCBString; AllocationSize: Int64; Status : DWORD) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbFltSetAllocationSizeEventN)(CallbackFilter* Sender, LPWSTR FileName, __int64 AllocationSize, LONG Status);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbFltSetAllocationSizeEventN)(System::TObject* Sender, TCBString FileName, __int64 AllocationSize, DWORD Status);

[C++ (.NET)]
    public delegate void CbFltSetAllocationSizeEventN(CallbackFilter^ Sender, String^ FileName, Int64 AllocationSize, Int32 Status);

[C#]
    delegate void CbFltSetAllocationSizeEventN(CallbackFilter Sender, string FileName, long AllocationSize, Int32 Status);

[VB.NET]
    Delegate Sub CbFltSetAllocationSizeEventN(ByVal Sender As CallbackFilter, ByVal FileName As String, ByVal AllocationSize As Long, ByVal Status As Int32)

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • FileName - name of the file
  • AllocationSize - the size of the space, allocated for the file. This size in most cases will be larger than the actual file size.
  • Status - status code of the completed operation

Description

This notification callback is called when the OS or the application needs to set the allocation size of the file.

AllocationSize is usually larger (and much larger) than the size of the file data. This happens because some file operations first reserve space for the file, then start writing actual data to this file. The application should track such situations and avoid re-allocating file space where possible to improve speed.

See also

OnSetAllocationSizeC    

Back to top