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

class 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:

  1. 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.
  2. 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).
  3. 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.
  4. 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).
  5. Later, the application can unmount the "media" from the virtual drive using the unmount method.
  6. 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.

storage_characteristicsThe characteristic flags to create the virtual drive with. (Windows only).
tagStores 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.

configSets or retrieves a configuration setting.
file_time_to_nanosecondsReturns the subsecond part of the time expressed in nanoseconds.
file_time_to_unix_timeConverts FileTime to unix time format.
fillerFills the buffer with information about a directory entry.
get_driver_statusRetrieves the status of the system driver.
get_driver_versionRetrieves the version of the system driver.
get_gidReturns the Group ID of the caller process.
get_uidReturns the User ID of the caller process.
initializeInitializes the class.
installInstalls or upgrades the product's system drivers (Windows only).
mountCreates a virtual drive or directory and mounts a filesystem.
uninstallUninstalls the product's system drivers (Windows only).
unix_time_to_file_timeConverts the date/time in Unix format to Windows FileTime format.
unmountUnmounts 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.

on_accessFires when the OS needs to check file access permissions.
on_chmodFires when the OS needs to change the permission bits of a file.
on_chownFires when the OS needs to change the owner and group of a file.
on_copy_file_rangeFires when the OS needs to copy a range of data from one file to another.
on_createFires when the OS wants to create a file.
on_destroyFires on filesystem exit.
on_errorFires if an unhandled error occurs during an event.
on_f_allocateFires when the OS needs to allocate space for an open file.
on_flushFires when the OS needs to flush an open file's data out to storage before the file is closed.
on_f_syncFires when the OS needs to flush an open file's data out to storage.
on_get_attrFires when the OS needs information about a file or directory.
on_initFires on filesystem startup.
on_lockFires when the OS needs to lock or unlock the range of bytes of a file.
on_mk_dirFires when the OS needs to create a directory.
on_openFires when the OS wants to open a file.
on_readFires when the OS needs to read data from an open file.
on_read_dirFires when the OS wants to read (enumerate) a directory's contents.
on_releaseFires when the OS needs to release (close) a file.
on_renameFires when the OS wants to rename or move a file or directory within the virtual filesystem.
on_rm_dirFires when the OS wants to remove (delete) a directory.
on_stat_fsFires when the OS needs information about the virtual drive's capacity and free space.
on_truncateFires when the OS needs to truncate (set the size of) a file.
on_unlinkFires when the OS wants to unlink (delete) a file.
on_utimensFires when the OS needs to change access and modification times of a file.
on_writeFires 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.

AsyncMountingPointNotificationsWhether system broadcasts for virtual drive mounting and unmounting are sent asynchronously.
TimeoutSpecifies how many milliseconds the driver will wait for events to execute before cancelling the underlying OS requests. (Windows-only).
BuildInfoInformation about the product's build.
LicenseInfoInformation about the current license.

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