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 this drive from its volume


Mount the specified volume in this drive.

Parameters:vol – anything accepted by volume()

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


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.



Dismount this volume from a particular filepath

Parameters:filepath – anything accepted by dir()

Mount this volume on a particular filepath

Parameters:filepath – anything accepted by dir()

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


An attribute set corresponding to some combination of VOLUME_FLAG


The user-assigned label set by the DOS LABEL command


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.


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.


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