StatFS Event

Fires when the OS needs information about the virtual drive's capacity and free space.

Syntax

// FUSEStatFSEventArgs carries the FUSE StatFS event's parameters.
type FUSEStatFSEventArgs struct {...}

func (args *FUSEStatFSEventArgs) Path() string
func (args *FUSEStatFSEventArgs) BlockSize() int64
func (args *FUSEStatFSEventArgs) SetBlockSize(value int64)
func (args *FUSEStatFSEventArgs) TotalBlocks() int64
func (args *FUSEStatFSEventArgs) SetTotalBlocks(value int64)
func (args *FUSEStatFSEventArgs) FreeBlocks() int64
func (args *FUSEStatFSEventArgs) SetFreeBlocks(value int64)
func (args *FUSEStatFSEventArgs) FreeBlocksAvail() int64
func (args *FUSEStatFSEventArgs) SetFreeBlocksAvail(value int64)
func (args *FUSEStatFSEventArgs) TotalFiles() int64
func (args *FUSEStatFSEventArgs) SetTotalFiles(value int64)
func (args *FUSEStatFSEventArgs) FreeFiles() int64
func (args *FUSEStatFSEventArgs) SetFreeFiles(value int64)
func (args *FUSEStatFSEventArgs) MaxFilenameLength() int32
func (args *FUSEStatFSEventArgs) SetMaxFilenameLength(value int32)
func (args *FUSEStatFSEventArgs) Result() int32
func (args *FUSEStatFSEventArgs) SetResult(value int32)

// FUSEStatFSEvent defines the signature of the FUSE StatFS event's handler function.
type FUSEStatFSEvent func(sender *FUSE, args *FUSEStatFSEventArgs)

func (obj *FUSE) GetOnStatFSHandler() FUSEStatFSEvent
func (obj *FUSE) SetOnStatFSHandler(handlerFunc FUSEStatFSEvent)

Remarks

This event fires anytime the OS needs to retrieve the virtual drive's total storage capacity and free space. This event is mandatory to handle, since without it, the OS won't be able to initialize the drive.

To handle this event properly, applications must set event parameters accordingly. BlockSize must be set to the size of the block. TotalBlocks must be set to the total number of blocks on the virtual drive, while FreeBlocks and FreeBlocksAvail denote the number of free blocks available to the system and to the unprivileged user respectively.

Windows:

The minimum drive size accepted by Windows is 6144 bytes. However, the component adjusts the minimum size to be at least 49152 bytes to ensure compatibility with possible changes in future Windows updates.

Linux:

TotalFiles and FreeFiles must be set to the total and available number of file slots (inodes) available within a filesystem. MaxFilenameLength should be set to the maximal length of the filename (path component) supported by the filesystem.

The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a negative error code value (e.g. -ENOENT to indicate that the file does not exist) to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.

Copyright (c) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS FUSE 2020 Go Edition - Version 20.0 [Build 8348]