Discuss this help topic in CBFS Forum

CallbackFileSystem.CorrectAllocationSize property


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

CallbackFileSystem     See also    


Enables or disables CBFS-initiated allocation size correction.


    property CorrectAllocationSize : boolean;

[C++ (Lib)]
    bool GetCorrectAllocationSize();
    void SetCorrectAllocationSize(BOOL Value);

[C++ (VCL)]
    bool CorrectAllocationSize;

[C++ (.NET)]
    bool CorrectAllocationSize;

    bool CorrectAllocationSize;

    Public Property CorrectAllocationSize As Boolean

    boolean getCorrectAllocationSize();
    void setCorrectAllocationSize(boolean value)


Use this property when you file system allows allocation size to be less than "end of file". The value of the property tells CBFS to perform or not perform allocation size correction (see below). Default value is true.

Allocation size specifies how many space in bytes a file is used on the storage. Usually allocation size is equal or more than "end of file". But in the case your file system can hold data remotely and only part of the file data is located on the local storage you can specify allocation size to be less. The property is necessary because CBFS internally caches allocation size for all currently opened files as well as in the metadata cache for the last opened files (in the case the MetaDataCacheEnabled property is true). For example when expanding a file (when the data is written to the end of the file) CBFS, when CorrectAllocationSize is set to true, automatically expands (corrects) the known allocation size to be more than the "end of file" value and OnSetAllocationSize callback is called.

If the property is false the allocation size remains unchanged. An application code should call NotifyDirectoryChange method with the fanAllocationSizeModified flag in order to inform CBFS and the OS about the change in the allocation size. Notification can be done in any time, for example, after some part of file data has been moved to remote storage.

Call from...

The property may be changed at any time but only from outside of callback / event handlers.

See also

NotifyDirectoryChange method     OnSetAllocationSize event

Discuss this help topic in CBFS Forum