GDrive: GDrive

Description Methods and Functions Hierarchy Detailed Description Structures Enums and Flags Signals Author(s) References

Description

Drive management

Methods and Functions

gDriveGetName(object)
gDriveGetIcon(object)
gDriveHasVolumes(object)
gDriveGetVolumes(object)
gDriveCanEject(object)
gDriveGetStartStopType(object)
gDriveCanStart(object)
gDriveCanStartDegraded(object)
gDriveCanStop(object)
gDriveCanPollForMedia(object)
gDrivePollForMedia(object, cancellable = NULL, callback, user.data = NULL)
gDrivePollForMediaFinish(object, result, .errwarn = TRUE)
gDriveHasMedia(object)
gDriveIsMediaCheckAutomatic(object)
gDriveIsMediaRemovable(object)
gDriveEject(object, flags = "G_MOUNT_UNMOUNT_NONE", cancellable = NULL, callback, user.data = NULL)
gDriveEjectFinish(object, result, .errwarn = TRUE)
gDriveEjectWithOperation(object, flags, mount.operation, cancellable = NULL, callback, user.data = NULL)
gDriveEjectWithOperationFinish(object, result, .errwarn = TRUE)
gDriveStart(object, flags, mount.operation, cancellable = NULL, callback, user.data = NULL)
gDriveStartFinish(object, result, .errwarn = TRUE)
gDriveStop(object, flags, mount.operation, cancellable = NULL, callback, user.data = NULL)
gDriveStopFinish(object, result, .errwarn = TRUE)
gDriveEnumerateIdentifiers(object)
gDriveGetIdentifier(object, kind)

Hierarchy

1
2
GInterface
   +----GDrive

Detailed Description

GDrive - this represent a piece of hardware connected to the machine. It's generally only created for removable hardware or hardware with removable media. GDrive is a container class for GVolume objects that stem from the same piece of media. As such, GDrive abstracts a drive with (or without) removable media and provides operations for querying whether media is available, determing whether media change is automatically detected and ejecting the media.

If the GDrive 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. GDrive 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 GDrive may vary according to implementation. To choose the correct verbs in e.g. a file manager, use gDriveGetStartStopType.

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

Structures

GDrive

Opaque drive object.

Enums and Flags

GDriveStartFlags

Flags used when starting a drive. Since 2.22

none

No flags set.

GDriveStartStopType

Enumeration describing how a drive can be started/stopped. Since 2.22

unknown

Unknown or drive doesn't support start/stop.

shutdown

The stop method will physically shut down the drive and e.g. power down the port the drive is attached to.

network

The start/stop methods are used for connecting/disconnect to the drive over the network.

multidisk

The start/stop methods will assemble/disassemble a virtual drive from several physical drives.

password

The start/stop methods will unlock/lock the disk (for example using the ATA “SECURITY UNLOCK DEVICE” command)

Signals

changed(drive, user.data)

Emitted when the drive's state has changed.

drive

a GDrive.

user.data

user data set when the signal handler was connected.

disconnected(drive, user.data)

This signal is emitted when the GDrive have been disconnected. If the recipient is holding references to the object they should release them so the object can be finalized.

drive

a GDrive.

user.data

user data set when the signal handler was connected.

eject-button(drive, user.data)

Emitted when the physical eject button (if any) of a drive has been pressed.

drive

a GDrive.

user.data

user data set when the signal handler was connected.

stop-button(drive, user.data)

Emitted when the physical stop button (if any) of a drive has been pressed. Since 2.22

drive

a GDrive.

user.data

user data set when the signal handler was connected.

Author(s)

Derived by RGtkGen from GTK+ documentation

References

https://developer.gnome.org/gio/stable/GDrive.html


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.

Related to GDrive in RGtk2...