The FUSE class gives applications the ability to create a virtual filesystem using FUSE-like API.
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.
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 on_open, on_read, on_get_attr, on_read_dir, 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.
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
|tag||Stores application-defined data specific to this instance of the class.|
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.|
|file_time_to_nanoseconds||Returns the subsecond part of the time expressed in nanoseconds.|
|file_time_to_unix_time||Converts FileTime to unix time format.|
|filler||Fills the buffer with information about a directory entry.|
|get_driver_status||Retrieves the status of the system driver.|
|get_driver_version||Retrieves the version of the system driver.|
|get_gid||Returns the Group ID of the caller process.|
|get_uid||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).|
|unix_time_to_file_time||Converts the date/time in Unix format to Windows FileTime format.|
|unmount||Unmounts a filesystem.|
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
|on_access||Fires when the OS needs to check file access permissions.|
|on_chmod||Fires when the OS needs to change the permission bits of a file.|
|on_chown||Fires when the OS needs to change the owner and group of a file.|
|on_copy_file_range||Fires when the OS needs to copy a range of data from one file to another.|
|on_create||Fires when the OS wants to create a file.|
|on_destroy||Fires on filesystem exit.|
|on_error||Fires if an unhandled error occurs during an event.|
|on_f_allocate||Fires when the OS needs to allocate space for an open file.|
|on_flush||Fires when the OS needs to flush an open file's data out to storage before the file is closed.|
|on_f_sync||Fires when the OS needs to flush an open file's data out to storage.|
|on_get_attr||Fires when the OS needs information about a file or directory.|
|on_init||Fires on filesystem startup.|
|on_mk_dir||Fires when the OS needs to create a directory.|
|on_open||Fires when the OS wants to open a file.|
|on_read||Fires when the OS needs to read data from an open file.|
|on_read_dir||Fires when the OS wants to read (enumerate) a directory's contents.|
|on_release||Fires when the OS needs to release (close) a file.|
|on_rename||Fires when the OS wants to rename or move a file or directory within the virtual filesystem.|
|on_rm_dir||Fires when the OS wants to remove (delete) a directory.|
|on_stat_fs||Fires when the OS needs information about the virtual drive's capacity and free space.|
|on_truncate||Fires when the OS needs to truncate (set the size of) a file.|
|on_unlink||Fires when the OS wants to unlink (delete) a file.|
|on_utimens||Fires when the OS needs to change access and modification times of a file.|
|on_write||Fires when the OS needs to write data to an open file.|
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
|StorageCharacteristics||The characteristic flags to create the virtual drive with (Windows only).|
|BuildInfo||Information about the product's build.|
|LicenseInfo||Information about the current license.|