FUSE Class
Properties Methods Events Configuration Settings Errors
The FUSE class gives applications the ability to create a virtual filesystem using FUSE-like API.
Syntax
cbfsfuse.fuse()
Remarks
The FUSE class is used to create a virtual filesystem whose contents are stored and exposed in an application-defined manner. The FUSE class offers applications an API similar to the one used by the FUSE library on Linux.
Getting Started
Each FUSE class instance controls a single virtual filesystem, and therefore a single virtual drive. Applications can use multiple instances of the FUSE class if their use-case requires the creation of multiple virtual drives; the class's Tag property can be used to distinguish between instances during event handlers.
Here's how to get up and running:
- If the system driver hasn't been installed yet, call the Install method to do so. This only needs to be done once.
- In production, the system driver can be installed (or updated) ahead-of-time by the application's installation script using the Installer DLL. Please refer to the Driver Installation topic for more information.
- Call the Initialize method to initialize the FUSE class. This must be done each time the application starts (if the application is using multiple FUSE class instances, only the first instance created should be used to call Initialize).
- Ensure that all of the necessary event handlers have been implemented. Some event handlers, such as Open, Read, GetAttr, ReadDir, etc; are mandatory and must be implemented by all applications (note that this is not an exhaustive list). Others are optional, and only need to be implemented when certain features are enabled. Please refer to the events' documentation for more information.
- Create a virtual drive by calling the Mount method. This operation incorporates several steps, such as creation of the virtual disk, mounting a "storage media" and adding a mounting point. A mounting point can be a drive letter, a UNC path, or a directory on an existing NTFS-formatted drive (see Mounting Points for details).
- Later, the application can unmount the "media" from the virtual drive using the Unmount method.
- To uninstall the system driver, call the Uninstall method. This should not be done as part of the driver upgrade process.
- In production, the system driver can be uninstalled by the application's uninstallation script using the Installer DLL. Please refer to the Driver Installation topic for more information.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
StorageCharacteristics | The characteristic flags to create the virtual drive with. (Windows only). |
Tag | Stores application-defined data specific to this instance of the class. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
FileTimeToNanoseconds | Returns the subsecond part of the time expressed in nanoseconds. |
FileTimeToUnixTime | Converts FileTime to unix time format. |
Filler | Fills the buffer with information about a directory entry. |
GetDriverStatus | Retrieves the status of the system driver. |
GetDriverVersion | Retrieves the version of the system driver. |
GetGid | Returns the Group ID of the caller process. |
GetUid | Returns the User ID of the caller process. |
Initialize | Initializes the class. |
Install | Installs or upgrades the product's system drivers. (Windows only). |
Mount | Creates a virtual drive or directory and mounts a filesystem. |
Uninstall | Uninstalls the product's system drivers. (Windows only). |
UnixTimeToFileTime | Converts the date/time in Unix format to Windows FileTime format. |
Unmount | Unmounts a filesystem. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Access | Fires when the OS needs to check file access permissions. |
Chmod | Fires when the OS needs to change the permission bits of a file. |
Chown | Fires when the OS needs to change the owner and group of a file. |
CopyFileRange | Fires when the OS needs to copy a range of data from one file to another. |
Create | Fires when the OS wants to create a file. |
Destroy | Fires on filesystem exit. |
Error | Fires if an unhandled error occurs during an event. |
FAllocate | Fires when the OS needs to allocate space for an open file. |
Flush | Fires when the OS needs to flush an open file's data out to storage before the file is closed. |
FSync | Fires when the OS needs to flush an open file's data out to storage. |
GetAttr | Fires when the OS needs information about a file or directory. |
Init | Fires on filesystem startup. |
Lock | Fires when the OS needs to lock or unlock the range of bytes of a file. |
MkDir | Fires when the OS needs to create a directory. |
Open | Fires when the OS wants to open a file. |
Read | Fires when the OS needs to read data from an open file. |
ReadDir | Fires when the OS wants to read (enumerate) a directory's contents. |
Release | Fires when the OS needs to release (close) a file. |
Rename | Fires when the OS wants to rename or move a file or directory within the virtual filesystem. |
RmDir | Fires when the OS wants to remove (delete) a directory. |
StatFS | Fires when the OS needs information about the virtual drive's capacity and free space. |
Truncate | Fires when the OS needs to truncate (set the size of) a file. |
Unlink | Fires when the OS wants to unlink (delete) a file. |
Utimens | Fires when the OS needs to change access and modification times of a file. |
Write | Fires when the OS needs to write data to an open file. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
AsyncMountingPointNotifications | Whether system broadcasts for virtual drive mounting and unmounting are sent asynchronously. |
Timeout | Specifies how many milliseconds the driver will wait for events to execute before cancelling the underlying OS requests. (Windows-only). |
BuildInfo | Information about the product's build. |
LicenseInfo | Information about the current license. |