The Drive class

class Drive(drive)

Wraps a drive letter, offering access to its Drive.volume and the ability to mount() or dismount() it on a particular volume.

dismount()

Dismount this drive from its volume

mount(vol)

Mount the specified volume in this drive.

Parameters:vol – anything accepted by volume()
Returns:self
root

Return a fs.Dir object corresponding to the root directory of this drive.

volume

Any volume currently mounted on this drive root. NB A drive can be referred to without a volume mounted, eg to call its mount() method.

The Volume class

class Volume(volume)

Wraps a filesystem volume, giving access to useful information such as the filesystem and a list of drives mounted on it. Also offers the ability to mount or dismount.

Attributes:

dismount(filepath)

Dismount this volume from a particular filepath

Parameters:filepath – anything accepted by dir()
mount(filepath)

Mount this volume on a particular filepath

Parameters:filepath – anything accepted by dir()
file_system_name

The name of the file system present on this volume, eg NTFS

flags

An attribute set corresponding to some combination of VOLUME_FLAG

label

The user-assigned label set by the DOS LABEL command

maximum_component_length

The maximum length any one component of the file system name can reach. For NTFS this is 255, meaning that any one segment of of the path can be no longer than 255 chars.

mounts

An iterator of the Dir objects which mount this volume. NB Windows restrictions mean that more than one drive root directory can mount the same volume simultaneously. But it is possible for a volume to be mounted on, eg, e:and c:mountse at the same time.

serial_number

A software serial number, not the hardware serial number assigned by the device manufacturer.

Table Of Contents

Previous topic

fs – Files, Directories, &c.

Next topic

The FilePath class

This Page