Basics
Guides
API Reference
Basics
Guides
API Reference
[509:14] static extends: object
Generated metadata helpers for Volume interface surfaces.
signals ()
Returns signal metadata for
Volume.
A list.[47:7] extends: object
The GVolume interface represents user-visible objects that can be mounted.
For example, a file system partition on a USB flash drive, or an optical disc
inserted into a disc drive. If a GVolume is currently mounted, the
corresponding [iface@Gio.Mount] can be retrieved using
[method@Gio.Volume.get_mount]. Mounting a GVolume instance is an
asynchronous operation. For more information about asynchronous operations,
see [iface@Gio.AsyncResult] and [class@Gio.Task]. To mount a GVolume, first
call [method@Gio.Volume.mount] with (at least) the GVolume instance,
optionally a [class@Gio.MountOperation] object and a
[type@Gio.AsyncReadyCallback]. Typically, one will only want to pass NULL
for the [class@Gio.MountOperation] if automounting all volumes when a desktop
session starts since it’s not desirable to put up a lot of dialogs asking for
credentials. The callback will be fired when the operation has resolved
(either with success or failure), and a [iface@Gio.AsyncResult] instance will
be passed to the callback. That callback should then call
[method@Gio.Volume.mount_finish] with the GVolume instance and the
[iface@Gio.AsyncResult] data to see if the operation was completed
successfully. If a [type@GLib.Error] is present when
[method@Gio.Volume.mount_finish] is called, then it will be filled with any
error information. Note, when porting from
GnomeVFS, GVolume is the moral equivalent of
GnomeVFSDrive. ## Volume Identifiers It is sometimes necessary to directly
access the underlying operating system object behind a volume (e.g. for
passing a volume to an application via the command line). For this purpose,
GIO allows to obtain an ‘identifier’ for the volume. There can be different
kinds of identifiers, such as Hal UDIs, filesystem labels, traditional Unix
devices (e.g. /dev/sda2), UUIDs. GIO uses predefined strings as names for
the different kinds of identifiers: G_VOLUME_IDENTIFIER_KIND_UUID,
G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use [method@Gio.Volume.get_identifier]
to obtain an identifier for a volume. Note that
G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available when the GVFS hal
volume monitor is in use. Other volume monitors will generally be able to
provide the G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE identifier, which can be
used to obtain a hal device by means of
libhal_manager_find_device_string_match().
Volume (Handle = null)
Creates a new
Volumeby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnChanged (callback Fn, UserData = null)
Emitted when the volume has been changed.
Fn is the Aussom callback.Fn is called with (Volume Self).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.setOnRemoved (callback Fn, UserData = null)
This signal is emitted when the #GVolume have been removed. If the recipient is holding references to the object they should release them so the object can be finalized.
Fn is the Aussom callback.Fn is called with (Volume Self).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.can_eject ()
Checks if a volume can be ejected.
can_mount ()
Checks if a volume can be mounted.
eject_finish (object result)
Finishes ejecting a volume. If any errors occurred during the operation,
will be set to contain the errors and %FALSE will be returned.result is a #GAsyncResult.eject_with_operation_finish (object result)
Finishes ejecting a volume. If any errors occurred during the operation,
will be set to contain the errors and %FALSE will be returned.result is a #GAsyncResult.enumerate_identifiers ()
Gets the kinds of identifiers that @volume has. Use g_volume_get_identifier() to obtain the identifiers themselves.
get_activation_root ()
Gets the activation root for a #GVolume if it is known ahead of mount time. Returns %NULL otherwise. If not %NULL and if @volume is mounted, then the result of g_mount_get_root() on the #GMount object obtained from g_volume_get_mount() will always either be equal or a prefix of what this function returns. In other words, in code |[ GMount *mount; GFile *mount_root GFile *volume_activation_root; mount = g_volume_get_mount (volume); // mounted, so never NULL mount_root = g_mount_get_root (mount); volume_activation_root = g_volume_get_activation_root (volume); // assume not NULL ]| then the expression |[ (g_file_has_prefix (volume_activation_root, mount_root) || g_file_equal (volume_activation_root, mount_root)) ]| will always be %TRUE. Activation roots are typically used in #GVolumeMonitor implementations to find the underlying mount to shadow, see g_mount_is_shadowed() for more details.
get_drive ()
Gets the drive for the @volume.
get_icon ()
Gets the icon for @volume.
get_identifier (string kind)
Gets the identifier of the given kind for @volume. See the introduction for more information about volume identifiers.
kind is the kind of identifier to return.get_mount ()
Gets the mount for the @volume.
get_name ()
Gets the name of @volume.
get_sort_key ()
Gets the sort key for @volume, if any.
get_symbolic_icon ()
Gets the symbolic icon for @volume.
get_uuid ()
Gets the UUID for the @volume. The reference is typically based on the file system UUID for the volume in question and should be considered an opaque string. Returns %NULL if there is no UUID available.
mount_finish (object result)
Finishes mounting a volume. If any errors occurred during the operation,
will be set to contain the errors and %FALSE will be returned. If the mount operation succeeded, g_volume_get_mount() on @volume is guaranteed to return the mount right after calling this function; there's no need to listen for the 'mount-added' signal on #GVolumeMonitor.result is a #GAsyncResult.should_automount ()
Returns whether the volume should be automatically mounted.
[439:7] extends: object
Generated low-level callback wrapper for GIR callback removed.
VolumeRemovedCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[369:7] extends: object
Generated low-level callback wrapper for GIR callback changed.
VolumeChangedCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.

Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.