CBFS Connect 2020 Python Edition

Questions / Feedback?

create_storage Method

Creates the virtual drive.

Syntax

def create_storage() -> None: ...

Remarks

This method creates the virtual drive (without mounting points) based on the following properties and configuration settings, which cannot be changed once the virtual storage has been created:

(Note that there are many other properties which, while not directly used by this method, nonetheless cannot be changed once a virtual drive is created. Such restrictions are noted where applicable.)

After the virtual drive is created, use the mount_media method to "insert storage media" into the virtual drive, and use the add_mounting_point method to create one or more mounting points for it.

The initialize method must have been called by some class instance in the application prior to calling this method.

Note: This method cannot be called within events.

Virtual Drives, Media, and Mounting Points

When applications call the create_storage method, a virtual drive is created. Virtual drives are created without any "media" in them (like a CD drive without a CD inserted), and without any mounting points (drive letters, UNC paths, etc.).

After creating a virtual drive, applications should call mount_media to "insert" virtual storage media into the virtual drive. This call will cause the class's events to start firing; applications must handle these events correctly, or the mount_media call will fail.

Once media has been mounted in the virtual drive, applications should use the add_mounting_point method to add one or more mounting points for the virtual drive. These mounting points make the virtual drive, visible to the system and other applications, allowing them to start accessing the contents of the CBFS-based virtual filesystem.

Note that applications can technically call add_mounting_point before mount_media (except for plug-and-play virtual drives with non-removable media; see storage_type), but any attempts to access a virtual drive with no media mounted will result in a "no media" error.

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