📄 gfile.html
字号:
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize">gsize</a> *length, char **etag_out, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);void <a class="link" href="GFile.html#g-file-load-contents-async">g_file_load_contents_async</a> (<a class="link" href="GFile.html" title="GFile">GFile</a> *file, <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="GFile.html#g-file-load-contents-finish">g_file_load_contents_finish</a> (<a class="link" href="GFile.html" title="GFile">GFile</a> *file, <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *res, char **contents, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize">gsize</a> *length, char **etag_out, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);void <a class="link" href="GFile.html#g-file-load-partial-contents-async">g_file_load_partial_contents_async</a> (<a class="link" href="GFile.html" title="GFile">GFile</a> *file, <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable, <a class="link" href="GFile.html#GFileReadMoreCallback">GFileReadMoreCallback</a> read_more_callback, <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="GFile.html#g-file-load-partial-contents-finish">g_file_load_partial_contents_finish</a> (<a class="link" href="GFile.html" title="GFile">GFile</a> *file, <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *res, char **contents, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize">gsize</a> *length, char **etag_out, <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="GFile.html#g-file-replace-contents">g_file_replace_contents</a> (<a class="link" href="GFile.html" title="GFile">GFile</a> *file, const char *contents, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize">gsize</a> length, const char *etag, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> make_backup, <a class="link" href="GFile.html#GFileCreateFlags">GFileCreateFlags</a> flags, char **new_etag, <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);void <a class="link" href="GFile.html#g-file-replace-contents-async">g_file_replace_contents_async</a> (<a class="link" href="GFile.html" title="GFile">GFile</a> *file, const char *contents, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize">gsize</a> length, const char *etag, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> make_backup, <a class="link" href="GFile.html#GFileCreateFlags">GFileCreateFlags</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="GFile.html#g-file-replace-contents-finish">g_file_replace_contents_finish</a> (<a class="link" href="GFile.html" title="GFile">GFile</a> *file, <a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *res, char **new_etag, <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="GFile.html#g-file-copy-attributes">g_file_copy_attributes</a> (<a class="link" href="GFile.html" title="GFile">GFile</a> *source, <a class="link" href="GFile.html" title="GFile">GFile</a> *destination, <a class="link" href="GFile.html#GFileCopyFlags">GFileCopyFlags</a> flags, <a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);</pre></div><div class="refsect1" lang="en"><a name="id3154118"></a><h2>Object Hierarchy</h2><pre class="synopsis"> GInterface +----GFile</pre></div><div class="refsect1" lang="en"><a name="id3154143"></a><h2>Prerequisites</h2><p>GFile 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="id3154166"></a><h2>Description</h2><p><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> is a high level abstraction for manipulating files on a virtual file system. <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>s are lightweight, immutable objects that do no I/O upon creation. It is necessary to understand that<a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> objects do not represent files, merely an identifier for a file. Allfile content I/O is implemented as streaming operations (see <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> and <a class="link" href="GOutputStream.html" title="GOutputStream"><span class="type">GOutputStream</span></a>).</p><p>To construct a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>, you can use: <a class="link" href="GFile.html#g-file-new-for-path"><code class="function">g_file_new_for_path()</code></a> if you have a path.<a class="link" href="GFile.html#g-file-new-for-uri"><code class="function">g_file_new_for_uri()</code></a> if you have a URI.<a class="link" href="GFile.html#g-file-new-for-commandline-arg"><code class="function">g_file_new_for_commandline_arg()</code></a> for a command line argument.<a class="link" href="GFile.html#g-file-parse-name"><code class="function">g_file_parse_name()</code></a> from a utf8 string gotten from <a class="link" href="GFile.html#g-file-get-parse-name"><code class="function">g_file_get_parse_name()</code></a>.</p><p>One way to think of a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> is as an abstraction of a pathname. For normalfiles the system pathname is what is stored internally, but as <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>sare extensible it could also be something else that corresponds to a pathnamein a userspace implementation of a filesystem.</p><p><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>s make up hierarchies of directories and files that correspond to thefiles on a filesystem. You can move through the file system with <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> using<a class="link" href="GFile.html#g-file-get-parent"><code class="function">g_file_get_parent()</code></a> to get an identifier for the parent directory, <a class="link" href="GFile.html#g-file-get-child"><code class="function">g_file_get_child()</code></a>to get a child within a directory, <a class="link" href="GFile.html#g-file-resolve-relative-path"><code class="function">g_file_resolve_relative_path()</code></a> to resolve a relativepath between two <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>s. There can be multiple hierarchies, so you may notend up at the same root if you repeatedly call <a class="link" href="GFile.html#g-file-get-parent"><code class="function">g_file_get_parent()</code></a> on two differentfiles.</p><p>All <a c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -