Gio.Drive

const Gio = imports.gi.Gio;

let drive = new Gio.Drive();
  

Gio.Drive - this represent a piece of hardware connected to the machine. It's generally only created for removable hardware or hardware with removable media.

Gio.Drive is a container class for Gio.Volume objects that stem from the same piece of media. As such, Gio.Drive abstracts a drive with (or without) removable media and provides operations for querying whether media is available, determining whether media change is automatically detected and ejecting the media.

If the Gio.Drive reports that media isn't automatically detected, one can poll for media; typically one should not do this periodically as a poll for media operation is potententially expensive and may spin up the drive creating noise.

Gio.Drive supports starting and stopping drives with authentication support for the former. This can be used to support a diverse set of use cases including connecting/disconnecting iSCSI devices, powering down external disk enclosures and starting/stopping multi-disk devices such as RAID devices. Note that the actual semantics and side-effects of starting/stopping a Gio.Drive may vary according to implementation. To choose the correct verbs in e.g. a file manager, use Gio.Drive.prototype.get_start_stop_type.

For porting from GnomeVFS note that there is no equivalent of Gio.Drive in that API.

Prerequisites

Drive requires GObject.Object

Known Implementations

None