Synopsis#include <gio/gio.h @see also: GVolume> #include <GUnixMount> GMount; GMountIface; char* g_mount_get_name (GMount *mount); char* g_mount_get_uuid (GMount *mount); GIcon* g_mount_get_icon (GMount *mount); GDrive* g_mount_get_drive (GMount *mount); GFile* g_mount_get_root (GMount *mount); GVolume* g_mount_get_volume (GMount *mount); gboolean g_mount_can_unmount (GMount *mount); enum GMountMountFlags; enum GMountUnmountFlags; void g_mount_unmount (GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean g_mount_unmount_finish (GMount *mount, GAsyncResult *result, GError **error); void g_mount_remount (GMount *mount, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean g_mount_remount_finish (GMount *mount, GAsyncResult *result, GError **error); gboolean g_mount_can_eject (GMount *mount); void g_mount_eject (GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean g_mount_eject_finish (GMount *mount, GAsyncResult *result, GError **error); void g_mount_guess_content_type (GMount *mount, gboolean force_rescan, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gchar** g_mount_guess_content_type_finish (GMount *mount, GAsyncResult *result, GError **error); gchar** g_mount_guess_content_type_sync (GMount *mount, gboolean force_rescan, GCancellable *cancellable, GError **error); DescriptionThe GMount interface represents user-visible mounts. Note, when porting from GnomeVFS, GMount is the moral equivalent of GnomeVFSVolume. GMount is a "mounted" filesystem that you can access. Mounted is in quotes because it's not the same as a unix mount, it might be a gvfs mount, but you can still access the files on it if you use GIO. Might or might not be related to a volume object.
Unmounting a GMount instance is an asynchronous operation. For
more information about asynchronous operations, see GAsyncReady
and GSimpleAsyncReady. To unmount a GMount instance, first call
DetailsGMountIfacetypedef struct { GTypeInterface g_iface; /* signals */ void (* changed) (GMount *mount); void (* unmounted) (GMount *mount); /* Virtual Table */ GFile * (* get_root) (GMount *mount); char * (* get_name) (GMount *mount); GIcon * (* get_icon) (GMount *mount); char * (* get_uuid) (GMount *mount); GVolume * (* get_volume) (GMount *mount); GDrive * (* get_drive) (GMount *mount); gboolean (* can_unmount) (GMount *mount); gboolean (* can_eject) (GMount *mount); void (* unmount) (GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* unmount_finish) (GMount *mount, GAsyncResult *result, GError **error); void (* eject) (GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* eject_finish) (GMount *mount, GAsyncResult *result, GError **error); void (* remount) (GMount *mount, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* remount_finish) (GMount *mount, GAsyncResult *result, GError **error); void (* guess_content_type) (GMount *mount, gboolean force_rescan, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gchar ** (* guess_content_type_finish) (GMount *mount, GAsyncResult *result, GError **error); gchar ** (* guess_content_type_sync) (GMount *mount, gboolean force_rescan, GCancellable *cancellable, GError **error); } GMountIface; Interface for implementing operations for mounts.
g_mount_get_name ()char* g_mount_get_name (GMount *mount);
Gets the name of
g_mount_get_uuid ()char* g_mount_get_uuid (GMount *mount);
Gets the UUID for the
g_mount_get_drive ()GDrive* g_mount_get_drive (GMount *mount);
Gets the drive for the This is a convenience method for getting the GVolume and then using that object to get the GDrive.
g_mount_can_unmount ()gboolean g_mount_can_unmount (GMount *mount);
Checks if
enum GMountMountFlagstypedef enum { G_MOUNT_MOUNT_NONE = 0 } GMountMountFlags; Flags used when mounting a mount.
enum GMountUnmountFlagstypedef enum { G_MOUNT_UNMOUNT_NONE = 0, G_MOUNT_UNMOUNT_FORCE = (1 << 0) } GMountUnmountFlags; Flags used when an unmounting a mount.
g_mount_unmount ()void g_mount_unmount (GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Unmounts a mount. This is an asynchronous operation, and is
finished by calling
g_mount_unmount_finish ()gboolean g_mount_unmount_finish (GMount *mount, GAsyncResult *result, GError **error);
Finishes unmounting a mount. If any errors occurred during the operation,
g_mount_remount ()void g_mount_remount (GMount *mount, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Remounts a mount. This is an asynchronous operation, and is
finished by calling Remounting is useful when some setting affecting the operation of the volume has been changed, as these may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting not all backends might need to actually be unmounted.
g_mount_remount_finish ()gboolean g_mount_remount_finish (GMount *mount, GAsyncResult *result, GError **error);
Finishes remounting a mount. If any errors occurred during the operation,
g_mount_can_eject ()gboolean g_mount_can_eject (GMount *mount);
Checks if
g_mount_eject ()void g_mount_eject (GMount *mount, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Ejects a mount. This is an asynchronous operation, and is
finished by calling
g_mount_eject_finish ()gboolean g_mount_eject_finish (GMount *mount, GAsyncResult *result, GError **error);
Finishes ejecting a mount. If any errors occurred during the operation,
g_mount_guess_content_type ()void g_mount_guess_content_type (GMount *mount, gboolean force_rescan, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Tries to guess the type of content stored on
This is an asynchronous operation (see
Since 2.18 g_mount_guess_content_type_finish ()gchar** g_mount_guess_content_type_finish (GMount *mount, GAsyncResult *result, GError **error);
Finishes guessing content types of
Since 2.18 g_mount_guess_content_type_sync ()gchar** g_mount_guess_content_type_sync (GMount *mount, gboolean force_rescan, GCancellable *cancellable, GError **error);
Tries to guess the type of content stored on
This is an synchronous operation and as such may block doing IO;
see
Since 2.18 Signal DetailsThe
|
|
the object on which the signal is emitted |
|
user data set when the signal handler was connected. |
"unmounted"
signalvoid user_function (GMount *mount, gpointer user_data) : Run Last
This signal is emitted when the GMount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized.
|
the object on which the signal is emitted |
|
user data set when the signal handler was connected. |