📄 gmount.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>GMount</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="GIO Reference Manual"><link rel="up" href="volume_mon.html" title="Volumes and Drives"><link rel="prev" href="GVolume.html" title="GVolume"><link rel="next" href="GDrive.html" title="GDrive"><meta name="generator" content="GTK-Doc V1.9 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="part" href="pt01.html" title="Part I. GIO Overview"><link rel="chapter" href="ch01.html" title="Introduction"><link rel="chapter" href="ch02.html" title="Compiling GIO applications"><link rel="chapter" href="ch03.html" title="Running GIO applications"><link rel="chapter" href="gio-extension-points.html" title="Extending GIO"><link rel="part" href="pt02.html" title="Part II. API Reference"><link rel="chapter" href="file_ops.html" title="File Operations"><link rel="chapter" href="file_mon.html" title="File System Monitoring"><link rel="chapter" href="async.html" title="Asynchronous I/O"><link rel="chapter" href="streaming.html" title="Streaming I/O"><link rel="chapter" href="types.html" title="File types and applications"><link rel="chapter" href="volume_mon.html" title="Volumes and Drives"><link rel="chapter" href="icons.html" title="Icons"><link rel="chapter" href="utils.html" title="Utilities"><link rel="chapter" href="extending.html" title="Extending GIO"><link rel="part" href="migrating.html" title="Part III. Migrating to GIO"><link rel="chapter" href="ch14.html" title="Migrating from POSIX to GIO"><link rel="chapter" href="ch15.html" title="Migrating from GnomeVFS to GIO"><link rel="chapter" href="gio-hierarchy.html" title="Object Hierarchy"><link rel="index" href="ix01.html" title="Index"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="GVolume.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="volume_mon.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GIO Reference Manual</th><td><a accesskey="n" href="GDrive.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#id3119142" class="shortcut">Top</a>  |  <a href="#id3212891" class="shortcut">Description</a>  |  <a href="#id3212844" class="shortcut">Object Hierarchy</a>  |  <a href="#id3212868" class="shortcut">Prerequisites</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="GMount"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id3119142"></a><span class="refentrytitle">GMount</span></h2><p>GMount — Mount management</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">#include <gio/gio.h@see also: GVolume>#include <GUnixMount> <a class="link" href="GMount.html#GMount-struct">GMount</a>; <a class="link" href="GMount.html#GMountIface">GMountIface</a>;char* <a class="link" href="GMount.html#g-mount-get-name">g_mount_get_name</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount);char* <a class="link" href="GMount.html#g-mount-get-uuid">g_mount_get_uuid</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount);<a class="link" href="GIcon.html" title="GIcon">GIcon</a>* <a class="link" href="GMount.html#g-mount-get-icon">g_mount_get_icon</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount);<a class="link" href="GDrive.html" title="GDrive">GDrive</a>* <a class="link" href="GMount.html#g-mount-get-drive">g_mount_get_drive</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount);<a class="link" href="GFile.html" title="GFile">GFile</a>* <a class="link" href="GMount.html#g-mount-get-root">g_mount_get_root</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount);<a class="link" href="GVolume.html" title="GVolume">GVolume</a>* <a class="link" href="GMount.html#g-mount-get-volume">g_mount_get_volume</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GMount.html#g-mount-can-unmount">g_mount_can_unmount</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount);enum <a class="link" href="GMount.html#GMountMountFlags">GMountMountFlags</a>;enum <a class="link" href="GMount.html#GMountUnmountFlags">GMountUnmountFlags</a>;void <a class="link" href="GMount.html#g-mount-unmount">g_mount_unmount</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount, <a class="link" href="GMount.html#GMountUnmountFlags">GMountUnmountFlags</a> flags, <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable, <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GMount.html#g-mount-unmount-finish">g_mount_unmount_finish</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount, <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);void <a class="link" href="GMount.html#g-mount-remount">g_mount_remount</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount, <a class="link" href="GMount.html#GMountMountFlags">GMountMountFlags</a> flags, <a class="link" href="GMountOperation.html" title="GMountOperation">GMountOperation</a> *mount_operation, <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable, <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GMount.html#g-mount-remount-finish">g_mount_remount_finish</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount, <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GMount.html#g-mount-can-eject">g_mount_can_eject</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount);void <a class="link" href="GMount.html#g-mount-eject">g_mount_eject</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount, <a class="link" href="GMount.html#GMountUnmountFlags">GMountUnmountFlags</a> flags, <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable, <a class="link" href="GAsyncResult.html#GAsyncReadyCallback">GAsyncReadyCallback</a> callback, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GMount.html#g-mount-eject-finish">g_mount_eject_finish</a> (<a class="link" href="GMount.html" title="GMount">GMount</a> *mount, <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);</pre></div><div class="refsect1" lang="en"><a name="id3212844"></a><h2>Object Hierarchy</h2><pre class="synopsis"> GInterface +----GMount</pre></div><div class="refsect1" lang="en"><a name="id3212868"></a><h2>Prerequisites</h2><p>GMount requires <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>.</p></div><div class="refsect1" lang="en"><a name="id3212891"></a><h2>Description</h2><p>The <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> interface represents user-visible mounts. Note, when porting from GnomeVFS, <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> is the moral equivalent of <span class="type">GnomeVFSVolume</span>.</p><p><a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> is a "mounted" filesystem that you can access. Mounted is inquotes because it's not the same as a unix mount, it might be a gvfsmount, but you can still access the files on it if you use GIO. Might ormight not be related to a volume object.</p><p>Unmounting a <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> instance is an asynchronous operation. Formore information about asynchronous operations, see <span class="type">GAsyncReady</span>and <span class="type">GSimpleAsyncReady</span>. To unmount a <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> instance, first call<a class="link" href="GMount.html#g-mount-unmount"><code class="function">g_mount_unmount()</code></a> with (at least) the <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> instance and a<a class="link" href="GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a>. The callback will be fired when theoperation has resolved (either with success or failure), and a<span class="type">GAsyncReady</span> structure will be passed to the callback. Thatcallback should then call <a class="link" href="GMount.html#g-mount-unmount-finish"><code class="function">g_mount_unmount_finish()</code></a> with the <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a>and the <span class="type">GAsyncReady</span> data to see if the operation was completedsuccessfully. If an <em class="parameter"><code>error</code></em> is present when <a class="link" href="GMount.html#g-mount-unmount-finish"><code class="function">g_mount_unmount_finish()</code></a> is called, then it will be filled with any error information.</p><p></p></div><div class="refsect1" lang="en"><a name="id3213054"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3224563"></a><h3><a name="GMount-struct"></a>GMount</h3><a class="indexterm" name="id3224575"></a><pre class="programlisting">typedef struct _GMount GMount;</pre><p>A handle to an object implementing the <a class="link" href="GMount.html#GMountIface"><span class="type">GMountIface</span></a> interface.</p><p></p></div><hr><div class="refsect2" lang="en"><a name="id3224601"></a><h3><a name="GMountIface"></a>GMountIface</h3><a class="indexterm" name="id3224613"></a><pre class="programlisting">typedef 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);} GMountIface;</pre><p>Interface for implementing operations for mounts.</p><p></p><div class="variablelist"><table border="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -