Discuss this help topic in CBFS Forum

CallbackFileSystem.ClusterSize property


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



Specifies the size of the cluster of the virtual disk.


    property ClusterSize : LongWord;

[C++ (Lib)]
    WORD GetClusterSize();
    void SetClusterSize(WORD Value);

[C++ (VCL)]
    unsigned long ClusterSize;

[C++ (.NET)]
    UInt32 ClusterSize;

    UInt32 ClusterSize;

    Public Property ClusterSize As UInt32

    int getClusterSize();
    void setClusterSize(int value);


Use this property to specify, how many bytes the virtual "cluster" on your disk contains. The value must be a multiple of sector size. Default value of 0 tells the driver to have cluster size equal to sector size.

All file systems used in Windows organize hard disk based on cluster size (also known as allocation unit size). Cluster size represents the smallest amount of disk space that can be used to hold a file. Common cluster sizes for FAT and NTFS are 4096, 8192 and 16384 bytes.

For Callback File System it doesn't matter what size of cluster is, but some applications request cluster size to calculate the buffer size used to transfer data in the read and write operations. So setting the cluster size to some larger value can increase speed of data transfer by decreasing the number of OnReadFile and OnWriteFile callbacks called.

Discuss this help topic in CBFS Forum