CBFS FUSE 2020 Node.js Edition

Questions / Feedback?

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:

  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 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.
  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.

StorageCharacteristicsThe 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.
FileTimeToNanosecondsReturns the subsecond part of the time expressed in nanoseconds.
FileTimeToUnixTimeConverts FileTime to unix time format.
FillerFills the buffer with information about a directory entry.
GetDriverStatusRetrieves the status of the system driver.
GetDriverVersionRetrieves the version of the system driver.
GetGidReturns the Group ID of the caller process.
GetUidReturns 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).
UnixTimeToFileTimeConverts 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.

AccessFires when the OS needs to check file access permissions.
ChmodFires when the OS needs to change the permission bits of a file.
ChownFires when the OS needs to change the owner and group of a file.
CopyFileRangeFires when the OS needs to copy a range of data from one file to another.
CreateFires when the OS wants to create a file.
DestroyFires on filesystem exit.
ErrorFires if an unhandled error occurs during an event.
FAllocateFires when the OS needs to allocate space for an open file.
FlushFires when the OS needs to flush an open file's data out to storage before the file is closed.
FSyncFires when the OS needs to flush an open file's data out to storage.
GetAttrFires when the OS needs information about a file or directory.
InitFires on filesystem startup.
LockFires when the OS needs to lock or unlock the range of bytes of a file.
MkDirFires when the OS needs to create a directory.
OpenFires when the OS wants to open a file.
ReadFires when the OS needs to read data from an open file.
ReadDirFires when the OS wants to read (enumerate) a directory's contents.
ReleaseFires when the OS needs to release (close) a file.
RenameFires when the OS wants to rename or move a file or directory within the virtual filesystem.
RmDirFires when the OS wants to remove (delete) a directory.
StatFSFires when the OS needs information about the virtual drive's capacity and free space.
TruncateFires when the OS needs to truncate (set the size of) a file.
UnlinkFires when the OS wants to unlink (delete) a file.
UtimensFires when the OS needs to change access and modification times of a file.
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 Node.js Edition - Version 20.0 [Build 8165]