mount_media Method

Mounts media in the virtual disk, making it accessible for reading and writing.

Syntax

def mount_media(timeout: int) -> None: ...

Remarks

After using create_storage to create a virtual disk, applications should call this method to "insert storage media" into it. For plug-and-play virtual disks with non-removable media (see storage_type), this method must be called before add_mounting_point is called. For all other virtual disks, add_mounting_point can be called before or after calling this method.

Timeout specifies how many milliseconds the driver will wait for events to execute before cancelling the underlying OS requests; please refer to the Timeouts topic for more information. Valid values are 0, which disables event timeouts, and values greater than or equal to 3000. (Passing a non-zero value less than 3000 will cause this method to fail with an ERROR_IMPLEMENTATION_LIMIT (1292, 0x50C) error code.)

When event timeouts are in effect, event handlers can call reset_timeout to reset the timer if they require additional time to complete an operation.

Note that there are a number of properties that cannot be changed once media is mounted. Such restrictions are noted in properties' documentation as applicable.

If this method encounters any issues during its execution, it fails with an errorraises an exception, and additional information is logged to the Windows system log as described in the Error Reporting and Handling topic.

Note: This method can only be called after creating a virtual disk, and cannot be called within events.

Virtual Disks, Media, and Mounting Points

When applications call the create_storage method, a virtual disk is created. Virtual disks 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 disk, applications should call on_mount_media to "insert" virtual storage media into the virtual disk. This call will cause the class's events to start firing; applications must handle these events correctly, or the on_mount_media call will fail.

Once media has been mounted in the virtual disk, applications should use the add_mounting_point method to add one or more mounting points for the virtual disk. These mounting points make the virtual disk available for use. Once it's formatted, the system and third-party applications can start accessing it.

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

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