⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.10
Server IP:
157.245.101.34
Server:
Linux skvinfotech-website 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
doc
/
libglib2.0-doc
/
gio
/
View File Name :
GFile.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>GFile: GIO Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="index.html" title="GIO Reference Manual"> <link rel="up" href="file_ops.html" title="File Operations"> <link rel="prev" href="file_ops.html" title="File Operations"> <link rel="next" href="gio-GFileAttribute.html" title="GFileAttribute"> <meta name="generator" content="GTK-Doc V1.32 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </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="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#GFile.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> <a href="#GFile.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_prerequisites"> <span class="dim">|</span> <a href="#GFile.prerequisites" class="shortcut">Prerequisites</a></span> </td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="file_ops.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="file_ops.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="gio-GFileAttribute.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="GFile"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="GFile.top_of_page"></a>GFile</span></h2> <p>GFile — File and Directory Handling</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="GFile.functions"></a><h2>Functions</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="functions_proto_type"> <col class="functions_proto_name"> </colgroup> <tbody> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GFile.html#GFileProgressCallback" title="GFileProgressCallback ()">*GFileProgressCallback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GFile.html#GFileReadMoreCallback" title="GFileReadMoreCallback ()">*GFileReadMoreCallback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GFile.html#GFileMeasureProgressCallback" title="GFileMeasureProgressCallback ()">*GFileMeasureProgressCallback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-new-for-path" title="g_file_new_for_path ()">g_file_new_for_path</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-new-for-uri" title="g_file_new_for_uri ()">g_file_new_for_uri</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-new-for-commandline-arg" title="g_file_new_for_commandline_arg ()">g_file_new_for_commandline_arg</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-new-for-commandline-arg-and-cwd" title="g_file_new_for_commandline_arg_and_cwd ()">g_file_new_for_commandline_arg_and_cwd</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-new-tmp" title="g_file_new_tmp ()">g_file_new_tmp</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-parse-name" title="g_file_parse_name ()">g_file_parse_name</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-new-build-filename" title="g_file_new_build_filename ()">g_file_new_build_filename</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-dup" title="g_file_dup ()">g_file_dup</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">guint</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-hash" title="g_file_hash ()">g_file_hash</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-equal" title="g_file_equal ()">g_file_equal</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-get-basename" title="g_file_get_basename ()">g_file_get_basename</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-get-path" title="g_file_get_path ()">g_file_get_path</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-peek-path" title="g_file_peek_path ()">g_file_peek_path</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-get-uri" title="g_file_get_uri ()">g_file_get_uri</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-get-parse-name" title="g_file_get_parse_name ()">g_file_get_parse_name</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-get-parent" title="g_file_get_parent ()">g_file_get_parent</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-has-parent" title="g_file_has_parent ()">g_file_has_parent</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-get-child" title="g_file_get_child ()">g_file_get_child</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-get-child-for-display-name" title="g_file_get_child_for_display_name ()">g_file_get_child_for_display_name</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-has-prefix" title="g_file_has_prefix ()">g_file_has_prefix</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-get-relative-path" title="g_file_get_relative_path ()">g_file_get_relative_path</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-resolve-relative-path" title="g_file_resolve_relative_path ()">g_file_resolve_relative_path</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-is-native" title="g_file_is_native ()">g_file_is_native</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-has-uri-scheme" title="g_file_has_uri_scheme ()">g_file_has_uri_scheme</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">char</span> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-get-uri-scheme" title="g_file_get_uri_scheme ()">g_file_get_uri_scheme</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-read" title="g_file_read ()">g_file_read</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-read-async" title="g_file_read_async ()">g_file_read_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-read-finish" title="g_file_read_finish ()">g_file_read_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-append-to" title="g_file_append_to ()">g_file_append_to</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-create" title="g_file_create ()">g_file_create</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace" title="g_file_replace ()">g_file_replace</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-append-to-async" title="g_file_append_to_async ()">g_file_append_to_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-append-to-finish" title="g_file_append_to_finish ()">g_file_append_to_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-create-async" title="g_file_create_async ()">g_file_create_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-create-finish" title="g_file_create_finish ()">g_file_create_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace-async" title="g_file_replace_async ()">g_file_replace_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace-finish" title="g_file_replace_finish ()">g_file_replace_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-info" title="g_file_query_info ()">g_file_query_info</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-info-async" title="g_file_query_info_async ()">g_file_query_info_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-info-finish" title="g_file_query_info_finish ()">g_file_query_info_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-exists" title="g_file_query_exists ()">g_file_query_exists</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileInfo.html#GFileType" title="enum GFileType"><span class="returnvalue">GFileType</span></a> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-file-type" title="g_file_query_file_type ()">g_file_query_file_type</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-filesystem-info" title="g_file_query_filesystem_info ()">g_file_query_filesystem_info</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-filesystem-info-async" title="g_file_query_filesystem_info_async ()">g_file_query_filesystem_info_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-filesystem-info-finish" title="g_file_query_filesystem_info_finish ()">g_file_query_filesystem_info_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GAppInfo.html" title="GAppInfo"><span class="returnvalue">GAppInfo</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-default-handler" title="g_file_query_default_handler ()">g_file_query_default_handler</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-default-handler-async" title="g_file_query_default_handler_async ()">g_file_query_default_handler_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GAppInfo.html" title="GAppInfo"><span class="returnvalue">GAppInfo</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-default-handler-finish" title="g_file_query_default_handler_finish ()">g_file_query_default_handler_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-measure-disk-usage" title="g_file_measure_disk_usage ()">g_file_measure_disk_usage</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-measure-disk-usage-async" title="g_file_measure_disk_usage_async ()">g_file_measure_disk_usage_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-measure-disk-usage-finish" title="g_file_measure_disk_usage_finish ()">g_file_measure_disk_usage_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GMount.html" title="GMount"><span class="returnvalue">GMount</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-find-enclosing-mount" title="g_file_find_enclosing_mount ()">g_file_find_enclosing_mount</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-find-enclosing-mount-async" title="g_file_find_enclosing_mount_async ()">g_file_find_enclosing_mount_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GMount.html" title="GMount"><span class="returnvalue">GMount</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-find-enclosing-mount-finish" title="g_file_find_enclosing_mount_finish ()">g_file_find_enclosing_mount_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="returnvalue">GFileEnumerator</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-enumerate-children" title="g_file_enumerate_children ()">g_file_enumerate_children</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-enumerate-children-async" title="g_file_enumerate_children_async ()">g_file_enumerate_children_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="returnvalue">GFileEnumerator</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-enumerate-children-finish" title="g_file_enumerate_children_finish ()">g_file_enumerate_children_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-display-name" title="g_file_set_display_name ()">g_file_set_display_name</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-display-name-async" title="g_file_set_display_name_async ()">g_file_set_display_name_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-display-name-finish" title="g_file_set_display_name_finish ()">g_file_set_display_name_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-delete" title="g_file_delete ()">g_file_delete</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-delete-async" title="g_file_delete_async ()">g_file_delete_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-delete-finish" title="g_file_delete_finish ()">g_file_delete_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-trash" title="g_file_trash ()">g_file_trash</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-trash-async" title="g_file_trash_async ()">g_file_trash_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-trash-finish" title="g_file_trash_finish ()">g_file_trash_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-copy" title="g_file_copy ()">g_file_copy</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-copy-async" title="g_file_copy_async ()">g_file_copy_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-copy-finish" title="g_file_copy_finish ()">g_file_copy_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-move" title="g_file_move ()">g_file_move</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-make-directory" title="g_file_make_directory ()">g_file_make_directory</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-make-directory-async" title="g_file_make_directory_async ()">g_file_make_directory_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-make-directory-finish" title="g_file_make_directory_finish ()">g_file_make_directory_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-make-directory-with-parents" title="g_file_make_directory_with_parents ()">g_file_make_directory_with_parents</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-make-symbolic-link" title="g_file_make_symbolic_link ()">g_file_make_symbolic_link</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="gio-GFileAttribute.html#GFileAttributeInfoList"><span class="returnvalue">GFileAttributeInfoList</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-settable-attributes" title="g_file_query_settable_attributes ()">g_file_query_settable_attributes</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="gio-GFileAttribute.html#GFileAttributeInfoList"><span class="returnvalue">GFileAttributeInfoList</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-query-writable-namespaces" title="g_file_query_writable_namespaces ()">g_file_query_writable_namespaces</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attribute" title="g_file_set_attribute ()">g_file_set_attribute</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attributes-from-info" title="g_file_set_attributes_from_info ()">g_file_set_attributes_from_info</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attributes-async" title="g_file_set_attributes_async ()">g_file_set_attributes_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attributes-finish" title="g_file_set_attributes_finish ()">g_file_set_attributes_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attribute-string" title="g_file_set_attribute_string ()">g_file_set_attribute_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attribute-byte-string" title="g_file_set_attribute_byte_string ()">g_file_set_attribute_byte_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attribute-uint32" title="g_file_set_attribute_uint32 ()">g_file_set_attribute_uint32</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attribute-int32" title="g_file_set_attribute_int32 ()">g_file_set_attribute_int32</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attribute-uint64" title="g_file_set_attribute_uint64 ()">g_file_set_attribute_uint64</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-set-attribute-int64" title="g_file_set_attribute_int64 ()">g_file_set_attribute_int64</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-mount-mountable" title="g_file_mount_mountable ()">g_file_mount_mountable</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-mount-mountable-finish" title="g_file_mount_mountable_finish ()">g_file_mount_mountable_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-unmount-mountable" title="g_file_unmount_mountable ()">g_file_unmount_mountable</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-unmount-mountable-finish" title="g_file_unmount_mountable_finish ()">g_file_unmount_mountable_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-unmount-mountable-with-operation" title="g_file_unmount_mountable_with_operation ()">g_file_unmount_mountable_with_operation</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-unmount-mountable-with-operation-finish" title="g_file_unmount_mountable_with_operation_finish ()">g_file_unmount_mountable_with_operation_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-eject-mountable" title="g_file_eject_mountable ()">g_file_eject_mountable</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-eject-mountable-finish" title="g_file_eject_mountable_finish ()">g_file_eject_mountable_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-eject-mountable-with-operation" title="g_file_eject_mountable_with_operation ()">g_file_eject_mountable_with_operation</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-eject-mountable-with-operation-finish" title="g_file_eject_mountable_with_operation_finish ()">g_file_eject_mountable_with_operation_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-start-mountable" title="g_file_start_mountable ()">g_file_start_mountable</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-start-mountable-finish" title="g_file_start_mountable_finish ()">g_file_start_mountable_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-stop-mountable" title="g_file_stop_mountable ()">g_file_stop_mountable</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-stop-mountable-finish" title="g_file_stop_mountable_finish ()">g_file_stop_mountable_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-poll-mountable" title="g_file_poll_mountable ()">g_file_poll_mountable</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-poll-mountable-finish" title="g_file_poll_mountable_finish ()">g_file_poll_mountable_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-mount-enclosing-volume" title="g_file_mount_enclosing_volume ()">g_file_mount_enclosing_volume</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-mount-enclosing-volume-finish" title="g_file_mount_enclosing_volume_finish ()">g_file_mount_enclosing_volume_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="returnvalue">GFileMonitor</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-monitor-directory" title="g_file_monitor_directory ()">g_file_monitor_directory</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="returnvalue">GFileMonitor</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-monitor-file" title="g_file_monitor_file ()">g_file_monitor_file</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="returnvalue">GFileMonitor</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-monitor" title="g_file_monitor ()">g_file_monitor</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GBytes</span> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-load-bytes" title="g_file_load_bytes ()">g_file_load_bytes</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-load-bytes-async" title="g_file_load_bytes_async ()">g_file_load_bytes_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GBytes</span> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-load-bytes-finish" title="g_file_load_bytes_finish ()">g_file_load_bytes_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-load-contents" title="g_file_load_contents ()">g_file_load_contents</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-load-contents-async" title="g_file_load_contents_async ()">g_file_load_contents_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-load-contents-finish" title="g_file_load_contents_finish ()">g_file_load_contents_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-load-partial-contents-async" title="g_file_load_partial_contents_async ()">g_file_load_partial_contents_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-load-partial-contents-finish" title="g_file_load_partial_contents_finish ()">g_file_load_partial_contents_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace-contents" title="g_file_replace_contents ()">g_file_replace_contents</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace-contents-async" title="g_file_replace_contents_async ()">g_file_replace_contents_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace-contents-bytes-async" title="g_file_replace_contents_bytes_async ()">g_file_replace_contents_bytes_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace-contents-finish" title="g_file_replace_contents_finish ()">g_file_replace_contents_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-copy-attributes" title="g_file_copy_attributes ()">g_file_copy_attributes</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-create-readwrite" title="g_file_create_readwrite ()">g_file_create_readwrite</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-create-readwrite-async" title="g_file_create_readwrite_async ()">g_file_create_readwrite_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-create-readwrite-finish" title="g_file_create_readwrite_finish ()">g_file_create_readwrite_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-open-readwrite" title="g_file_open_readwrite ()">g_file_open_readwrite</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-open-readwrite-async" title="g_file_open_readwrite_async ()">g_file_open_readwrite_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-open-readwrite-finish" title="g_file_open_readwrite_finish ()">g_file_open_readwrite_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace-readwrite" title="g_file_replace_readwrite ()">g_file_replace_readwrite</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace-readwrite-async" title="g_file_replace_readwrite_async ()">g_file_replace_readwrite_async</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-replace-readwrite-finish" title="g_file_replace_readwrite_finish ()">g_file_replace_readwrite_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GFile.html#g-file-supports-thread-contexts" title="g_file_supports_thread_contexts ()">g_file_supports_thread_contexts</a> <span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="GFile.other"></a><h2>Types and Values</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="other_proto_type"> <col class="other_proto_name"> </colgroup> <tbody> <tr> <td class="datatype_keyword"> </td> <td class="function_name"><a class="link" href="GFile.html#GFile-struct" title="GFile">GFile</a></td> </tr> <tr> <td class="datatype_keyword">struct</td> <td class="function_name"><a class="link" href="GFile.html#GFileIface" title="struct GFileIface">GFileIface</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags">GFileQueryInfoFlags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags">GFileCreateFlags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GFile.html#GFileCopyFlags" title="enum GFileCopyFlags">GFileCopyFlags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GFile.html#GFileMonitorFlags" title="enum GFileMonitorFlags">GFileMonitorFlags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GFile.html#GFileMeasureFlags" title="enum GFileMeasureFlags">GFileMeasureFlags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GFile.html#GFilesystemPreviewType" title="enum GFilesystemPreviewType">GFilesystemPreviewType</a></td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="GFile.object-hierarchy"></a><h2>Object Hierarchy</h2> <pre class="screen"> GEnum <span class="lineart">╰──</span> GFilesystemPreviewType GFlags <span class="lineart">├──</span> GFileCopyFlags <span class="lineart">├──</span> GFileCreateFlags <span class="lineart">├──</span> GFileMeasureFlags <span class="lineart">├──</span> GFileMonitorFlags <span class="lineart">╰──</span> GFileQueryInfoFlags GInterface <span class="lineart">╰──</span> GFile </pre> </div> <div class="refsect1"> <a name="GFile.prerequisites"></a><h2>Prerequisites</h2> <p> GFile requires GObject.</p> </div> <div class="refsect1"> <a name="GFile.includes"></a><h2>Includes</h2> <pre class="synopsis">#include <gio/gio.h> </pre> </div> <div class="refsect1"> <a name="GFile.description"></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. <span class="type">GFiles</span> 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. All file 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:</p> <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"><p>g_file_new_for_path() if you have a path.</p></li> <li class="listitem"><p>g_file_new_for_uri() if you have a URI.</p></li> <li class="listitem"><p>g_file_new_for_commandline_arg() for a command line argument.</p></li> <li class="listitem"><p>g_file_new_tmp() to create a temporary file from a template.</p></li> <li class="listitem"><p>g_file_parse_name() from a UTF-8 string gotten from <a class="link" href="GFile.html#g-file-get-parse-name" title="g_file_get_parse_name ()"><code class="function">g_file_get_parse_name()</code></a>.</p></li> <li class="listitem"><p>g_file_new_build_filename() to create a file from path elements.</p></li> </ul></div> <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 normal files the system pathname is what is stored internally, but as <span class="type">GFiles</span> are extensible it could also be something else that corresponds to a pathname in a userspace implementation of a filesystem.</p> <p><span class="type">GFiles</span> make up hierarchies of directories and files that correspond to the files 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" title="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" title="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" title="g_file_resolve_relative_path ()"><code class="function">g_file_resolve_relative_path()</code></a> to resolve a relative path between two <span class="type">GFiles</span>. There can be multiple hierarchies, so you may not end up at the same root if you repeatedly call <a class="link" href="GFile.html#g-file-get-parent" title="g_file_get_parent ()"><code class="function">g_file_get_parent()</code></a> on two different files.</p> <p>All <span class="type">GFiles</span> have a basename (get with <a class="link" href="GFile.html#g-file-get-basename" title="g_file_get_basename ()"><code class="function">g_file_get_basename()</code></a>). These names are byte strings that are used to identify the file on the filesystem (relative to its parent directory) and there is no guarantees that they have any particular charset encoding or even make any sense at all. If you want to use filenames in a user interface you should use the display name that you can get by requesting the <a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-STANDARD-DISPLAY-NAME:CAPS" title="G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME"><code class="literal">G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</code></a> attribute with <a class="link" href="GFile.html#g-file-query-info" title="g_file_query_info ()"><code class="function">g_file_query_info()</code></a>. This is guaranteed to be in UTF-8 and can be used in a user interface. But always store the real basename or the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to use to actually access the file, because there is no way to go from a display name to the actual name.</p> <p>Using <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> as an identifier has the same weaknesses as using a path in that there may be multiple aliases for the same file. For instance, hard or soft links may cause two different <span class="type">GFiles</span> to refer to the same file. Other possible causes for aliases are: case insensitive filesystems, short and long names on FAT/NTFS, or bind mounts in Linux. If you want to check if two <span class="type">GFiles</span> point to the same file you can query for the <a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-ID-FILE:CAPS" title="G_FILE_ATTRIBUTE_ID_FILE"><code class="literal">G_FILE_ATTRIBUTE_ID_FILE</code></a> attribute. Note that <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> does some trivial canonicalization of pathnames passed in, so that trivial differences in the path string used at creation (duplicated slashes, slash at end of path, "." or ".." path segments, etc) does not create different <span class="type">GFiles</span>.</p> <p>Many <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> operations have both synchronous and asynchronous versions to suit your application. Asynchronous versions of synchronous functions simply have <a class="link" href="async.html" title="Asynchronous I/O"><code class="function">_async()</code></a> appended to their function names. The asynchronous I/O functions call a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> which is then used to finalize the operation, producing a GAsyncResult which is then passed to the function's matching <code class="function">_finish()</code> operation.</p> <p>It is highly recommended to use asynchronous calls when running within a shared main loop, such as in the main thread of an application. This avoids I/O operations blocking other sources on the main loop from being dispatched. Synchronous I/O operations should be performed from worker threads. See the introduction to asynchronous programming section for more.</p> <p>Some <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> operations almost always take a noticeable amount of time, and so do not have synchronous analogs. Notable cases include:</p> <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"><p>g_file_mount_mountable() to mount a mountable file.</p></li> <li class="listitem"><p>g_file_unmount_mountable_with_operation() to unmount a mountable file.</p></li> <li class="listitem"><p>g_file_eject_mountable_with_operation() to eject a mountable file.</p></li> </ul></div> <div class="refsect3"> <a name="gfile-etag"></a><h4>Entity Tags</h4> <p>One notable feature of <span class="type">GFiles</span> are entity tags, or "etags" for short. Entity tags are somewhat like a more abstract version of the traditional mtime, and can be used to quickly determine if the file has been modified from the version on the file system. See the HTTP 1.1 <a class="ulink" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" target="_top">specification</a> for HTTP Etag headers, which are a very similar concept.</p> </div> </div> <div class="refsect1"> <a name="GFile.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="GFileProgressCallback"></a><h3>GFileProgressCallback ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> <span class="c_punctuation">(</span>*GFileProgressCallback<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">goffset</span> current_num_bytes</code></em>, <em class="parameter"><code><span class="type">goffset</span> total_num_bytes</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>When doing file operations that may take a while, such as moving a file or copying a file, a progress callback is used to pass how far along that operation is to the application.</p> <div class="refsect3"> <a name="GFileProgressCallback.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>current_num_bytes</p></td> <td class="parameter_description"><p>the current number of bytes in the operation.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>total_num_bytes</p></td> <td class="parameter_description"><p>the total number of bytes in the operation.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>user data passed to the callback.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="GFileReadMoreCallback"></a><h3>GFileReadMoreCallback ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> <span class="c_punctuation">(</span>*GFileReadMoreCallback<span class="c_punctuation">)</span> (<em class="parameter"><code>const <span class="type">char</span> *file_contents</code></em>, <em class="parameter"><code><span class="type">goffset</span> file_size</code></em>, <em class="parameter"><code><span class="type">gpointer</span> callback_data</code></em>);</pre> <p>When loading the partial contents of a file with <a class="link" href="GFile.html#g-file-load-partial-contents-async" title="g_file_load_partial_contents_async ()"><code class="function">g_file_load_partial_contents_async()</code></a>, it may become necessary to determine if any more data from the file should be loaded. A <a class="link" href="GFile.html#GFileReadMoreCallback" title="GFileReadMoreCallback ()"><span class="type">GFileReadMoreCallback</span></a> function facilitates this by returning <code class="literal">TRUE</code> if more data should be read, or <code class="literal">FALSE</code> otherwise.</p> <div class="refsect3"> <a name="GFileReadMoreCallback.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file_contents</p></td> <td class="parameter_description"><p>the data as currently read.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>file_size</p></td> <td class="parameter_description"><p>the size of the data currently read.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback_data</p></td> <td class="parameter_description"><p>data passed to the callback. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="GFileReadMoreCallback.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if more data should be read back. <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="GFileMeasureProgressCallback"></a><h3>GFileMeasureProgressCallback ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> <span class="c_punctuation">(</span>*GFileMeasureProgressCallback<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">gboolean</span> reporting</code></em>, <em class="parameter"><code><span class="type">guint64</span> current_size</code></em>, <em class="parameter"><code><span class="type">guint64</span> num_dirs</code></em>, <em class="parameter"><code><span class="type">guint64</span> num_files</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>This callback type is used by <a class="link" href="GFile.html#g-file-measure-disk-usage" title="g_file_measure_disk_usage ()"><code class="function">g_file_measure_disk_usage()</code></a> to make periodic progress reports when measuring the amount of disk spaced used by a directory.</p> <p>These calls are made on a best-effort basis and not all types of <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> will support them. At the minimum, however, one call will always be made immediately.</p> <p>In the case that there is no support, <em class="parameter"><code>reporting</code></em> will be set to <code class="literal">FALSE</code> (and the other values undefined) and no further calls will be made. Otherwise, the <em class="parameter"><code>reporting</code></em> will be <code class="literal">TRUE</code> and the other values all-zeros during the first (immediate) call. In this way, you can know which type of progress UI to show without a delay.</p> <p>For <a class="link" href="GFile.html#g-file-measure-disk-usage" title="g_file_measure_disk_usage ()"><code class="function">g_file_measure_disk_usage()</code></a> the callback is made directly. For <a class="link" href="GFile.html#g-file-measure-disk-usage-async" title="g_file_measure_disk_usage_async ()"><code class="function">g_file_measure_disk_usage_async()</code></a> the callback is made via the default main context of the calling thread (ie: the same way that the final async result would be reported).</p> <p><em class="parameter"><code>current_size</code></em> is in the same units as requested by the operation (see <a class="link" href="GFile.html#G-FILE-MEASURE-APPARENT-SIZE:CAPS"><code class="literal">G_FILE_MEASURE_APPARENT_SIZE</code></a>).</p> <p>The frequency of the updates is implementation defined, but is ideally about once every 200ms.</p> <p>The last progress callback may or may not be equal to the final result. Always check the async result to get the final value.</p> <div class="refsect3"> <a name="GFileMeasureProgressCallback.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>reporting</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if more reports will come</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>current_size</p></td> <td class="parameter_description"><p>the current cumulative size measurement</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>num_dirs</p></td> <td class="parameter_description"><p>the number of directories visited so far</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>num_files</p></td> <td class="parameter_description"><p>the number of non-directory files encountered</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data passed to the original request for this callback</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-new-for-path"></a><h3>g_file_new_for_path ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_new_for_path (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>);</pre> <p>Constructs a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> for a given path. This operation never fails, but the returned object might not support any I/O operation if <em class="parameter"><code>path</code></em> is malformed.</p> <div class="refsect3"> <a name="g-file-new-for-path.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>path</p></td> <td class="parameter_description"><p>a string containing a relative or absolute path. The string must be encoded in the glib filename encoding. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span></td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-new-for-path.returns"></a><h4>Returns</h4> <p>a new <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> for the given <em class="parameter"><code>path</code></em> . Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-new-for-uri"></a><h3>g_file_new_for_uri ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_new_for_uri (<em class="parameter"><code>const <span class="type">char</span> *uri</code></em>);</pre> <p>Constructs a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> for a given URI. This operation never fails, but the returned object might not support any I/O operation if <em class="parameter"><code>uri</code></em> is malformed or if the uri type is not supported.</p> <div class="refsect3"> <a name="g-file-new-for-uri.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>uri</p></td> <td class="parameter_description"><p>a UTF-8 string containing a URI</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-new-for-uri.returns"></a><h4>Returns</h4> <p>a new <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> for the given <em class="parameter"><code>uri</code></em> . Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-new-for-commandline-arg"></a><h3>g_file_new_for_commandline_arg ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_new_for_commandline_arg (<em class="parameter"><code>const <span class="type">char</span> *arg</code></em>);</pre> <p>Creates a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> with the given argument from the command line. The value of <em class="parameter"><code>arg</code></em> can be either a URI, an absolute path or a relative path resolved relative to the current working directory. This operation never fails, but the returned object might not support any I/O operation if <em class="parameter"><code>arg</code></em> points to a malformed path.</p> <p>Note that on Windows, this function expects its argument to be in UTF-8 -- not the system code page. This means that you should not use this function with string from argv as it is passed to <code class="function">main()</code>. <code class="function">g_win32_get_command_line()</code> will return a UTF-8 version of the commandline. <a class="link" href="GApplication.html" title="GApplication"><span class="type">GApplication</span></a> also uses UTF-8 but <a class="link" href="GApplicationCommandLine.html#g-application-command-line-create-file-for-arg" title="g_application_command_line_create_file_for_arg ()"><code class="function">g_application_command_line_create_file_for_arg()</code></a> may be more useful for you there. It is also always possible to use this function with <span class="type">GOptionContext</span> arguments of type <code class="literal">G_OPTION_ARG_FILENAME</code>.</p> <div class="refsect3"> <a name="g-file-new-for-commandline-arg.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>arg</p></td> <td class="parameter_description"><p>a command line string. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span></td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-new-for-commandline-arg.returns"></a><h4>Returns</h4> <p>a new <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-new-for-commandline-arg-and-cwd"></a><h3>g_file_new_for_commandline_arg_and_cwd ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_new_for_commandline_arg_and_cwd (<em class="parameter"><code>const <span class="type">gchar</span> *arg</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *cwd</code></em>);</pre> <p>Creates a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> with the given argument from the command line.</p> <p>This function is similar to <a class="link" href="GFile.html#g-file-new-for-commandline-arg" title="g_file_new_for_commandline_arg ()"><code class="function">g_file_new_for_commandline_arg()</code></a> except that it allows for passing the current working directory as an argument instead of using the current working directory of the process.</p> <p>This is useful if the commandline argument was given in a context other than the invocation of the current process.</p> <p>See also <a class="link" href="GApplicationCommandLine.html#g-application-command-line-create-file-for-arg" title="g_application_command_line_create_file_for_arg ()"><code class="function">g_application_command_line_create_file_for_arg()</code></a>.</p> <div class="refsect3"> <a name="g-file-new-for-commandline-arg-and-cwd.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>arg</p></td> <td class="parameter_description"><p>a command line string. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span></td> </tr> <tr> <td class="parameter_name"><p>cwd</p></td> <td class="parameter_description"><p>the current working directory of the commandline. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-new-for-commandline-arg-and-cwd.returns"></a><h4>Returns</h4> <p>a new <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-36.html#api-index-2.36">2.36</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-new-tmp"></a><h3>g_file_new_tmp ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_new_tmp (<em class="parameter"><code>const <span class="type">char</span> *tmpl</code></em>, <em class="parameter"><code><a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> **iostream</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Opens a file in the preferred directory for temporary files (as returned by <code class="function">g_get_tmp_dir()</code>) and returns a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> and <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> pointing to it.</p> <p><em class="parameter"><code>tmpl</code></em> should be a string in the GLib file name encoding containing a sequence of six 'X' characters, and containing no directory components. If it is <code class="literal">NULL</code>, a default template is used.</p> <p>Unlike the other <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> constructors, this will return <code class="literal">NULL</code> if a temporary file could not be created.</p> <div class="refsect3"> <a name="g-file-new-tmp.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>tmpl</p></td> <td class="parameter_description"><p>Template for the file name, as in <code class="function">g_file_open_tmp()</code>, or <code class="literal">NULL</code> for a default template. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>iostream</p></td> <td class="parameter_description"><p>on return, a <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> for the created file. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-new-tmp.returns"></a><h4>Returns</h4> <p>a new <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-parse-name"></a><h3>g_file_parse_name ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_parse_name (<em class="parameter"><code>const <span class="type">char</span> *parse_name</code></em>);</pre> <p>Constructs a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> with the given <em class="parameter"><code>parse_name</code></em> (i.e. something given by <a class="link" href="GFile.html#g-file-get-parse-name" title="g_file_get_parse_name ()"><code class="function">g_file_get_parse_name()</code></a>). This operation never fails, but the returned object might not support any I/O operation if the <em class="parameter"><code>parse_name</code></em> cannot be parsed.</p> <div class="refsect3"> <a name="g-file-parse-name.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>parse_name</p></td> <td class="parameter_description"><p>a file name or path to be parsed</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-parse-name.returns"></a><h4>Returns</h4> <p>a new <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-new-build-filename"></a><h3>g_file_new_build_filename ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_new_build_filename (<em class="parameter"><code>const <span class="type">gchar</span> *first_element</code></em>, <em class="parameter"><code>...</code></em>);</pre> <p>Constructs a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> from a series of elements using the correct separator for filenames.</p> <p>Using this function is equivalent to calling <code class="function">g_build_filename()</code>, followed by <a class="link" href="GFile.html#g-file-new-for-path" title="g_file_new_for_path ()"><code class="function">g_file_new_for_path()</code></a> on the result.</p> <div class="refsect3"> <a name="g-file-new-build-filename.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>first_element</p></td> <td class="parameter_description"><p>the first element in the path. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span></td> </tr> <tr> <td class="parameter_name"><p>...</p></td> <td class="parameter_description"><p>remaining elements in path, terminated by <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-new-build-filename.returns"></a><h4>Returns</h4> <p>a new <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-56.html#api-index-2.56">2.56</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-dup"></a><h3>g_file_dup ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_dup (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Duplicates a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> handle. This operation does not duplicate the actual file or directory represented by the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>; see <a class="link" href="GFile.html#g-file-copy" title="g_file_copy ()"><code class="function">g_file_copy()</code></a> if attempting to copy a file.</p> <p>g_file_dup() is useful when a second handle is needed to the same underlying file, for use in a separate thread (<a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> is not thread-safe). For use within the same thread, use <code class="function">g_object_ref()</code> to increment the existing object’s reference count.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-dup.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-dup.returns"></a><h4>Returns</h4> <p>a new <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> that is a duplicate of the given <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-hash"></a><h3>g_file_hash ()</h3> <pre class="programlisting"><span class="returnvalue">guint</span> g_file_hash (<em class="parameter"><code><span class="type">gconstpointer</span> file</code></em>);</pre> <p>Creates a hash value for a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p> <p>This call does no blocking I/O.</p> <p>Virtual: hash</p> <div class="refsect3"> <a name="g-file-hash.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p><span class="type">gconstpointer</span> to a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GFile]</span></td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-hash.returns"></a><h4>Returns</h4> <p> 0 if <em class="parameter"><code>file</code></em> is not a valid <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>, otherwise an integer that can be used as hash value for the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. This function is intended for easily hashing a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to add to a <span class="type">GHashTable</span> or similar data structure.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-equal"></a><h3>g_file_equal ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_equal (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file1</code></em>, <em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file2</code></em>);</pre> <p>Checks if the two given <span class="type">GFiles</span> refer to the same file.</p> <p>Note that two <span class="type">GFiles</span> that differ can still refer to the same file on the filesystem due to various forms of filename aliasing.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-equal.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file1</p></td> <td class="parameter_description"><p>the first <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>file2</p></td> <td class="parameter_description"><p>the second <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-equal.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if <em class="parameter"><code>file1</code></em> and <em class="parameter"><code>file2</code></em> are equal.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-get-basename"></a><h3>g_file_get_basename ()</h3> <pre class="programlisting"><span class="returnvalue">char</span> * g_file_get_basename (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Gets the base name (the last component of the path) for a given <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p> <p>If called for the top level of a system (such as the filesystem root or a uri like sftp://host/) it will return a single directory separator (and on Windows, possibly a drive letter).</p> <p>The base name is a byte string (not UTF-8). It has no defined encoding or rules other than it may not contain zero bytes. If you want to use filenames in a user interface you should use the display name that you can get by requesting the <a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-STANDARD-DISPLAY-NAME:CAPS" title="G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME"><code class="literal">G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</code></a> attribute with <a class="link" href="GFile.html#g-file-query-info" title="g_file_query_info ()"><code class="function">g_file_query_info()</code></a>.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-get-basename.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-get-basename.returns"></a><h4>Returns</h4> <p>string containing the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>'s base name, or <code class="literal">NULL</code> if given <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> is invalid. The returned string should be freed with <code class="function">g_free()</code> when no longer needed. </p> <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-get-path"></a><h3>g_file_get_path ()</h3> <pre class="programlisting"><span class="returnvalue">char</span> * g_file_get_path (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Gets the local pathname for <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>, if one exists. If non-<code class="literal">NULL</code>, this is guaranteed to be an absolute, canonical path. It might contain symlinks.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-get-path.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-get-path.returns"></a><h4>Returns</h4> <p>string containing the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>'s path, or <code class="literal">NULL</code> if no such path exists. The returned string should be freed with <code class="function">g_free()</code> when no longer needed. </p> <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-peek-path"></a><h3>g_file_peek_path ()</h3> <pre class="programlisting">const <span class="returnvalue">char</span> * g_file_peek_path (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Exactly like <a class="link" href="GFile.html#g-file-get-path" title="g_file_get_path ()"><code class="function">g_file_get_path()</code></a>, but caches the result via <code class="function">g_object_set_qdata_full()</code>. This is useful for example in C applications which mix <code class="literal">g_file_*</code> APIs with native ones. It also avoids an extra duplicated string when possible, so will be generally more efficient.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-peek-path.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-peek-path.returns"></a><h4>Returns</h4> <p>string containing the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>'s path, or <code class="literal">NULL</code> if no such path exists. The returned string is owned by <em class="parameter"><code>file</code></em> . </p> <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-56.html#api-index-2.56">2.56</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-get-uri"></a><h3>g_file_get_uri ()</h3> <pre class="programlisting"><span class="returnvalue">char</span> * g_file_get_uri (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Gets the URI for the <em class="parameter"><code>file</code></em> .</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-get-uri.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-get-uri.returns"></a><h4>Returns</h4> <p> a string containing the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>'s URI. The returned string should be freed with <code class="function">g_free()</code> when no longer needed.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-get-parse-name"></a><h3>g_file_get_parse_name ()</h3> <pre class="programlisting"><span class="returnvalue">char</span> * g_file_get_parse_name (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Gets the parse name of the <em class="parameter"><code>file</code></em> . A parse name is a UTF-8 string that describes the file such that one can get the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> back using <a class="link" href="GFile.html#g-file-parse-name" title="g_file_parse_name ()"><code class="function">g_file_parse_name()</code></a>.</p> <p>This is generally used to show the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> as a nice full-pathname kind of string in a user interface, like in a location entry.</p> <p>For local files with names that can safely be converted to UTF-8 the pathname is used, otherwise the IRI is used (a form of URI that allows UTF-8 characters unescaped).</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-get-parse-name.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-get-parse-name.returns"></a><h4>Returns</h4> <p> a string containing the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>'s parse name. The returned string should be freed with <code class="function">g_free()</code> when no longer needed.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-get-parent"></a><h3>g_file_get_parent ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_get_parent (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Gets the parent directory for the <em class="parameter"><code>file</code></em> . If the <em class="parameter"><code>file</code></em> represents the root directory of the file system, then <code class="literal">NULL</code> will be returned.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-get-parent.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-get-parent.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> structure to the parent of the given <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> or <code class="literal">NULL</code> if there is no parent. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-has-parent"></a><h3>g_file_has_parent ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_has_parent (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *parent</code></em>);</pre> <p>Checks if <em class="parameter"><code>file</code></em> has a parent, and optionally, if it is <em class="parameter"><code>parent</code></em> .</p> <p>If <em class="parameter"><code>parent</code></em> is <code class="literal">NULL</code> then this function returns <code class="literal">TRUE</code> if <em class="parameter"><code>file</code></em> has any parent at all. If <em class="parameter"><code>parent</code></em> is non-<code class="literal">NULL</code> then <code class="literal">TRUE</code> is only returned if <em class="parameter"><code>file</code></em> is an immediate child of <em class="parameter"><code>parent</code></em> .</p> <div class="refsect3"> <a name="g-file-has-parent.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>parent</p></td> <td class="parameter_description"><p>the parent to check for, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-has-parent.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if <em class="parameter"><code>file</code></em> is an immediate child of <em class="parameter"><code>parent</code></em> (or any parent in the case that <em class="parameter"><code>parent</code></em> is <code class="literal">NULL</code>).</p> </div> <p class="since">Since: <a class="link" href="api-index-2-24.html#api-index-2.24">2.24</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-get-child"></a><h3>g_file_get_child ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_get_child (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre> <p>Gets a child of <em class="parameter"><code>file</code></em> with basename equal to <em class="parameter"><code>name</code></em> .</p> <p>Note that the file with that specific name might not exist, but you can still have a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> that points to it. You can use this for instance to create that file.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-get-child.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>name</p></td> <td class="parameter_description"><p>string containing the child's basename. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-get-child.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to a child specified by <em class="parameter"><code>name</code></em> . Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-get-child-for-display-name"></a><h3>g_file_get_child_for_display_name ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_get_child_for_display_name (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *display_name</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Gets the child of <em class="parameter"><code>file</code></em> for a given <em class="parameter"><code>display_name</code></em> (i.e. a UTF-8 version of the name). If this function fails, it returns <code class="literal">NULL</code> and <em class="parameter"><code>error</code></em> will be set. This is very useful when constructing a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> for a new file and the user entered the filename in the user interface, for instance when you select a directory and type a filename in the file selector.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-get-child-for-display-name.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>display_name</p></td> <td class="parameter_description"><p>string to a possible child</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for an error</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-get-child-for-display-name.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to the specified child, or <code class="literal">NULL</code> if the display name couldn't be converted. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-has-prefix"></a><h3>g_file_has_prefix ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_has_prefix (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *prefix</code></em>);</pre> <p>Checks whether <em class="parameter"><code>file</code></em> has the prefix specified by <em class="parameter"><code>prefix</code></em> .</p> <p>In other words, if the names of initial elements of <em class="parameter"><code>file</code></em> 's pathname match <em class="parameter"><code>prefix</code></em> . Only full pathname elements are matched, so a path like /foo is not considered a prefix of /foobar, only of /foo/bar.</p> <p>A <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> is not a prefix of itself. If you want to check for equality, use <a class="link" href="GFile.html#g-file-equal" title="g_file_equal ()"><code class="function">g_file_equal()</code></a>.</p> <p>This call does no I/O, as it works purely on names. As such it can sometimes return <code class="literal">FALSE</code> even if <em class="parameter"><code>file</code></em> is inside a <em class="parameter"><code>prefix</code></em> (from a filesystem point of view), because the prefix of <em class="parameter"><code>file</code></em> is an alias of <em class="parameter"><code>prefix</code></em> .</p> <p>Virtual: prefix_matches</p> <div class="refsect3"> <a name="g-file-has-prefix.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>prefix</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-has-prefix.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>file</code></em> 's parent, grandparent, etc is <em class="parameter"><code>prefix</code></em> , <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-get-relative-path"></a><h3>g_file_get_relative_path ()</h3> <pre class="programlisting"><span class="returnvalue">char</span> * g_file_get_relative_path (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *parent</code></em>, <em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *descendant</code></em>);</pre> <p>Gets the path for <em class="parameter"><code>descendant</code></em> relative to <em class="parameter"><code>parent</code></em> .</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-get-relative-path.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>parent</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>descendant</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-get-relative-path.returns"></a><h4>Returns</h4> <p>string with the relative path from <em class="parameter"><code>descendant</code></em> to <em class="parameter"><code>parent</code></em> , or <code class="literal">NULL</code> if <em class="parameter"><code>descendant</code></em> doesn't have <em class="parameter"><code>parent</code></em> as prefix. The returned string should be freed with <code class="function">g_free()</code> when no longer needed. </p> <p><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-resolve-relative-path"></a><h3>g_file_resolve_relative_path ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_resolve_relative_path (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *relative_path</code></em>);</pre> <p>Resolves a relative path for <em class="parameter"><code>file</code></em> to an absolute path.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-resolve-relative-path.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>relative_path</p></td> <td class="parameter_description"><p>a given relative path string. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-resolve-relative-path.returns"></a><h4>Returns</h4> <p><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to the resolved path. <code class="literal">NULL</code> if <em class="parameter"><code>relative_path</code></em> is <code class="literal">NULL</code> or if <em class="parameter"><code>file</code></em> is invalid. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-is-native"></a><h3>g_file_is_native ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_is_native (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Checks to see if a file is native to the platform.</p> <p>A native file is one expressed in the platform-native filename format, e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local, as it might be on a locally mounted remote filesystem.</p> <p>On some systems non-native files may be available using the native filesystem via a userspace filesystem (FUSE), in these cases this call will return <code class="literal">FALSE</code>, but <a class="link" href="GFile.html#g-file-get-path" title="g_file_get_path ()"><code class="function">g_file_get_path()</code></a> will still return a native path.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-is-native.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-is-native.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if <em class="parameter"><code>file</code></em> is native</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-has-uri-scheme"></a><h3>g_file_has_uri_scheme ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_has_uri_scheme (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *uri_scheme</code></em>);</pre> <p>Checks to see if a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> has a given URI scheme.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-has-uri-scheme.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>uri_scheme</p></td> <td class="parameter_description"><p>a string containing a URI scheme</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-has-uri-scheme.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>'s backend supports the given URI scheme, <code class="literal">FALSE</code> if URI scheme is <code class="literal">NULL</code>, not supported, or <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> is invalid.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-get-uri-scheme"></a><h3>g_file_get_uri_scheme ()</h3> <pre class="programlisting"><span class="returnvalue">char</span> * g_file_get_uri_scheme (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Gets the URI scheme for a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. RFC 3986 decodes the scheme as:</p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1</pre></td> <td class="listing_code"><pre class="programlisting"><span class="n">URI</span> <span class="o">=</span> <span class="n">scheme</span> <span class="s">":"</span> <span class="n">hier</span><span class="o">-</span><span class="n">part</span> <span class="p">[</span> <span class="s">"?"</span> <span class="n">query</span> <span class="p">]</span> <span class="p">[</span> <span class="s">"#"</span> <span class="n">fragment</span> <span class="p">]</span></pre></td> </tr> </tbody> </table> </div> <p> Common schemes include "file", "http", "ftp", etc.</p> <p>This call does no blocking I/O.</p> <div class="refsect3"> <a name="g-file-get-uri-scheme.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-get-uri-scheme.returns"></a><h4>Returns</h4> <p> a string containing the URI scheme for the given <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. The returned string should be freed with <code class="function">g_free()</code> when no longer needed.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-read"></a><h3>g_file_read ()</h3> <pre class="programlisting"><a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> * g_file_read (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Opens a file for reading. The result is a <a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="type">GFileInputStream</span></a> that can be used to read the contents of the file.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If the file does not exist, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-FOUND:CAPS"><code class="literal">G_IO_ERROR_NOT_FOUND</code></a> error will be returned. If the file is a directory, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-IS-DIRECTORY:CAPS"><code class="literal">G_IO_ERROR_IS_DIRECTORY</code></a> error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.</p> <p>Virtual: read_fn</p> <div class="refsect3"> <a name="g-file-read.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to read</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-read.returns"></a><h4>Returns</h4> <p><a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="type">GFileInputStream</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-read-async"></a><h3>g_file_read_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_read_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously opens <em class="parameter"><code>file</code></em> for reading.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-read" title="g_file_read ()"><code class="function">g_file_read()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-read-finish" title="g_file_read_finish ()"><code class="function">g_file_read_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-read-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-read-finish"></a><h3>g_file_read_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> * g_file_read_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous file read operation started with <a class="link" href="GFile.html#g-file-read-async" title="g_file_read_async ()"><code class="function">g_file_read_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-read-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-read-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="type">GFileInputStream</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-append-to"></a><h3>g_file_append_to ()</h3> <pre class="programlisting"><a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * g_file_append_to (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Gets an output stream for appending data to the file. If the file doesn't already exist it is created.</p> <p>By default files created are generally readable by everyone, but if you pass <a class="link" href="GFile.html#G-FILE-CREATE-PRIVATE:CAPS"><span class="type">G_FILE_CREATE_PRIVATE</span></a> in <em class="parameter"><code>flags</code></em> the file will be made readable only to the current user, to the level that is supported on the target filesystem.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>Some file systems don't allow all file names, and may return an <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-FILENAME:CAPS"><code class="literal">G_IO_ERROR_INVALID_FILENAME</code></a> error. If the file is a directory the <a class="link" href="gio-GIOError.html#G-IO-ERROR-IS-DIRECTORY:CAPS"><code class="literal">G_IO_ERROR_IS_DIRECTORY</code></a> error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.</p> <div class="refsect3"> <a name="g-file-append-to.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-append-to.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="type">GFileOutputStream</span></a>, or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-create"></a><h3>g_file_create ()</h3> <pre class="programlisting"><a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * g_file_create (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Creates a new file and returns an output stream for writing to it. The file must not already exist.</p> <p>By default files created are generally readable by everyone, but if you pass <a class="link" href="GFile.html#G-FILE-CREATE-PRIVATE:CAPS"><span class="type">G_FILE_CREATE_PRIVATE</span></a> in <em class="parameter"><code>flags</code></em> the file will be made readable only to the current user, to the level that is supported on the target filesystem.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If a file or directory with this name already exists the <a class="link" href="gio-GIOError.html#G-IO-ERROR-EXISTS:CAPS"><code class="literal">G_IO_ERROR_EXISTS</code></a> error will be returned. Some file systems don't allow all file names, and may return an <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-FILENAME:CAPS"><code class="literal">G_IO_ERROR_INVALID_FILENAME</code></a> error, and if the name is to long <a class="link" href="gio-GIOError.html#G-IO-ERROR-FILENAME-TOO-LONG:CAPS"><code class="literal">G_IO_ERROR_FILENAME_TOO_LONG</code></a> will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.</p> <div class="refsect3"> <a name="g-file-create.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-create.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="type">GFileOutputStream</span></a> for the newly created file, or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-replace"></a><h3>g_file_replace ()</h3> <pre class="programlisting"><a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * g_file_replace (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *etag</code></em>, <em class="parameter"><code><span class="type">gboolean</span> make_backup</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Returns an output stream for overwriting the file, possibly creating a backup copy of the file first. If the file doesn't exist, it will be created.</p> <p>This will try to replace the file in the safest way possible so that any errors during the writing will not affect an already existing copy of the file. For instance, for local files it may write to a temporary file and then atomically rename over the destination when the stream is closed.</p> <p>By default files created are generally readable by everyone, but if you pass <a class="link" href="GFile.html#G-FILE-CREATE-PRIVATE:CAPS"><span class="type">G_FILE_CREATE_PRIVATE</span></a> in <em class="parameter"><code>flags</code></em> the file will be made readable only to the current user, to the level that is supported on the target filesystem.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If you pass in a non-<code class="literal">NULL</code> <em class="parameter"><code>etag</code></em> value and <em class="parameter"><code>file</code></em> already exists, then this value is compared to the current entity tag of the file, and if they differ an <a class="link" href="gio-GIOError.html#G-IO-ERROR-WRONG-ETAG:CAPS"><code class="literal">G_IO_ERROR_WRONG_ETAG</code></a> error is returned. This generally means that the file has been changed since you last read it. You can get the new etag from <a class="link" href="GFileOutputStream.html#g-file-output-stream-get-etag" title="g_file_output_stream_get_etag ()"><code class="function">g_file_output_stream_get_etag()</code></a> after you've finished writing and closed the <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="type">GFileOutputStream</span></a>. When you load a new file you can use <a class="link" href="GFileInputStream.html#g-file-input-stream-query-info" title="g_file_input_stream_query_info ()"><code class="function">g_file_input_stream_query_info()</code></a> to get the etag of the file.</p> <p>If <em class="parameter"><code>make_backup</code></em> is <code class="literal">TRUE</code>, this function will attempt to make a backup of the current file before overwriting it. If this fails a <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANT-CREATE-BACKUP:CAPS"><code class="literal">G_IO_ERROR_CANT_CREATE_BACKUP</code></a> error will be returned. If you want to replace anyway, try again with <em class="parameter"><code>make_backup</code></em> set to <code class="literal">FALSE</code>.</p> <p>If the file is a directory the <a class="link" href="gio-GIOError.html#G-IO-ERROR-IS-DIRECTORY:CAPS"><code class="literal">G_IO_ERROR_IS_DIRECTORY</code></a> error will be returned, and if the file is some other form of non-regular file then a <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-REGULAR-FILE:CAPS"><code class="literal">G_IO_ERROR_NOT_REGULAR_FILE</code></a> error will be returned. Some file systems don't allow all file names, and may return an <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-FILENAME:CAPS"><code class="literal">G_IO_ERROR_INVALID_FILENAME</code></a> error, and if the name is to long <a class="link" href="gio-GIOError.html#G-IO-ERROR-FILENAME-TOO-LONG:CAPS"><code class="literal">G_IO_ERROR_FILENAME_TOO_LONG</code></a> will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.</p> <div class="refsect3"> <a name="g-file-replace.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>etag</p></td> <td class="parameter_description"><p>an optional <a class="link" href="GFile.html#gfile-etag" title="Entity Tags">entity tag</a> for the current <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>, or <span class="type">NULL</span> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>make_backup</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if a backup should be created</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-replace.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="type">GFileOutputStream</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-append-to-async"></a><h3>g_file_append_to_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_append_to_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously opens <em class="parameter"><code>file</code></em> for appending.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-append-to" title="g_file_append_to ()"><code class="function">g_file_append_to()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-append-to-finish" title="g_file_append_to_finish ()"><code class="function">g_file_append_to_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-append-to-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-append-to-finish"></a><h3>g_file_append_to_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * g_file_append_to_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous file append operation started with <a class="link" href="GFile.html#g-file-append-to-async" title="g_file_append_to_async ()"><code class="function">g_file_append_to_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-append-to-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-append-to-finish.returns"></a><h4>Returns</h4> <p>a valid <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="type">GFileOutputStream</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-create-async"></a><h3>g_file_create_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_create_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-create" title="g_file_create ()"><code class="function">g_file_create()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-create-finish" title="g_file_create_finish ()"><code class="function">g_file_create_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-create-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-create-finish"></a><h3>g_file_create_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * g_file_create_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous file create operation started with <a class="link" href="GFile.html#g-file-create-async" title="g_file_create_async ()"><code class="function">g_file_create_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-create-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-create-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="type">GFileOutputStream</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-replace-async"></a><h3>g_file_replace_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_replace_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *etag</code></em>, <em class="parameter"><code><span class="type">gboolean</span> make_backup</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-replace" title="g_file_replace ()"><code class="function">g_file_replace()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-replace-finish" title="g_file_replace_finish ()"><code class="function">g_file_replace_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-replace-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>etag</p></td> <td class="parameter_description"><p>an <a class="link" href="GFile.html#gfile-etag" title="Entity Tags">entity tag</a> for the current <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>, or <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>make_backup</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if a backup should be created</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-replace-finish"></a><h3>g_file_replace_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="returnvalue">GFileOutputStream</span></a> * g_file_replace_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous file replace operation started with <a class="link" href="GFile.html#g-file-replace-async" title="g_file_replace_async ()"><code class="function">g_file_replace_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-replace-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-replace-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileOutputStream.html" title="GFileOutputStream"><span class="type">GFileOutputStream</span></a>, or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-info"></a><h3>g_file_query_info ()</h3> <pre class="programlisting"><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * g_file_query_info (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attributes</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Gets the requested information about specified <em class="parameter"><code>file</code></em> . The result is a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> object that contains key-value attributes (such as the type or size of the file).</p> <p>The <em class="parameter"><code>attributes</code></em> value is a string that specifies the file attributes that should be gathered. It is not an error if it's not possible to read a particular requested attribute from a file - it just won't be set. <em class="parameter"><code>attributes</code></em> should be a comma-separated list of attributes or attribute wildcards. The wildcard "*" means all attributes, and a wildcard like "standard::*" means all attributes in the standard namespace. An example attribute query be "standard::*,owner::user". The standard attributes are available as defines, like <a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-STANDARD-NAME:CAPS" title="G_FILE_ATTRIBUTE_STANDARD_NAME"><span class="type">G_FILE_ATTRIBUTE_STANDARD_NAME</span></a>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>For symlinks, normally the information about the target of the symlink is returned, rather than information about the symlink itself. However if you pass <a class="link" href="GFile.html#G-FILE-QUERY-INFO-NOFOLLOW-SYMLINKS:CAPS"><span class="type">G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS</span></a> in <em class="parameter"><code>flags</code></em> the information about the symlink itself will be returned. Also, for symlinks that point to non-existing files the information about the symlink itself will be returned.</p> <p>If the file does not exist, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-FOUND:CAPS"><code class="literal">G_IO_ERROR_NOT_FOUND</code></a> error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.</p> <div class="refsect3"> <a name="g-file-query-info.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attributes</p></td> <td class="parameter_description"><p>an attribute query string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-info.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> for the given <em class="parameter"><code>file</code></em> , or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-info-async"></a><h3>g_file_query_info_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_query_info_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attributes</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously gets the requested information about specified <em class="parameter"><code>file</code></em> . The result is a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> object that contains key-value attributes (such as type or size for the file).</p> <p>For more details, see <a class="link" href="GFile.html#g-file-query-info" title="g_file_query_info ()"><code class="function">g_file_query_info()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-query-info-finish" title="g_file_query_info_finish ()"><code class="function">g_file_query_info_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-query-info-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attributes</p></td> <td class="parameter_description"><p>an attribute query string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-info-finish"></a><h3>g_file_query_info_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * g_file_query_info_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous file info query. See <a class="link" href="GFile.html#g-file-query-info-async" title="g_file_query_info_async ()"><code class="function">g_file_query_info_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-query-info-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-info-finish.returns"></a><h4>Returns</h4> <p><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> for given <em class="parameter"><code>file</code></em> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-exists"></a><h3>g_file_query_exists ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_query_exists (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre> <p>Utility function to check if a particular file exists. This is implemented using <a class="link" href="GFile.html#g-file-query-info" title="g_file_query_info ()"><code class="function">g_file_query_info()</code></a> and as such does blocking I/O.</p> <p>Note that in many cases it is <a class="ulink" href="https://en.wikipedia.org/wiki/Time_of_check_to_time_of_use" target="_top">racy to first check for file existence</a> and then execute something based on the outcome of that, because the file might have been created or removed in between the operations. The general approach to handling that is to not check, but just do the operation and handle the errors as they come.</p> <p>As an example of race-free checking, take the case of reading a file, and if it doesn't exist, creating it. There are two racy versions: read it, and on error create it; and: check if it exists, if not create it. These can both result in two processes creating the file (with perhaps a partially written file as the result). The correct approach is to always try to create the file with <a class="link" href="GFile.html#g-file-create" title="g_file_create ()"><code class="function">g_file_create()</code></a> which will either atomically create the file or fail with a <a class="link" href="gio-GIOError.html#G-IO-ERROR-EXISTS:CAPS"><code class="literal">G_IO_ERROR_EXISTS</code></a> error.</p> <p>However, in many cases an existence check is useful in a user interface, for instance to make a menu item sensitive/insensitive, so that you don't have to fool users that something is possible and then just show an error dialog. If you do this, you should make sure to also handle the errors that can happen due to races when you execute the operation.</p> <div class="refsect3"> <a name="g-file-query-exists.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-exists.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the file exists (and can be detected without error), <code class="literal">FALSE</code> otherwise (or if cancelled).</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-file-type"></a><h3>g_file_query_file_type ()</h3> <pre class="programlisting"><a class="link" href="GFileInfo.html#GFileType" title="enum GFileType"><span class="returnvalue">GFileType</span></a> g_file_query_file_type (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre> <p>Utility function to inspect the <a class="link" href="GFileInfo.html#GFileType" title="enum GFileType"><span class="type">GFileType</span></a> of a file. This is implemented using <a class="link" href="GFile.html#g-file-query-info" title="g_file_query_info ()"><code class="function">g_file_query_info()</code></a> and as such does blocking I/O.</p> <p>The primary use case of this method is to check if a file is a regular file, directory, or symlink.</p> <div class="refsect3"> <a name="g-file-query-file-type.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> passed to <a class="link" href="GFile.html#g-file-query-info" title="g_file_query_info ()"><code class="function">g_file_query_info()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-file-type.returns"></a><h4>Returns</h4> <p> The <a class="link" href="GFileInfo.html#GFileType" title="enum GFileType"><span class="type">GFileType</span></a> of the file and <a class="link" href="GFileInfo.html#G-FILE-TYPE-UNKNOWN:CAPS"><span class="type">G_FILE_TYPE_UNKNOWN</span></a> if the file does not exist</p> </div> <p class="since">Since: <a class="link" href="api-index-2-18.html#api-index-2.18">2.18</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-query-filesystem-info"></a><h3>g_file_query_filesystem_info ()</h3> <pre class="programlisting"><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * g_file_query_filesystem_info (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attributes</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Similar to <a class="link" href="GFile.html#g-file-query-info" title="g_file_query_info ()"><code class="function">g_file_query_info()</code></a>, but obtains information about the filesystem the <em class="parameter"><code>file</code></em> is on, rather than the file itself. For instance the amount of space available and the type of the filesystem.</p> <p>The <em class="parameter"><code>attributes</code></em> value is a string that specifies the attributes that should be gathered. It is not an error if it's not possible to read a particular requested attribute from a file - it just won't be set. <em class="parameter"><code>attributes</code></em> should be a comma-separated list of attributes or attribute wildcards. The wildcard "*" means all attributes, and a wildcard like "filesystem::*" means all attributes in the filesystem namespace. The standard namespace for filesystem attributes is "filesystem". Common attributes of interest are <a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-FILESYSTEM-SIZE:CAPS" title="G_FILE_ATTRIBUTE_FILESYSTEM_SIZE"><span class="type">G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</span></a> (the total size of the filesystem in bytes), <a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-FILESYSTEM-FREE:CAPS" title="G_FILE_ATTRIBUTE_FILESYSTEM_FREE"><span class="type">G_FILE_ATTRIBUTE_FILESYSTEM_FREE</span></a> (number of bytes available), and <a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-FILESYSTEM-TYPE:CAPS" title="G_FILE_ATTRIBUTE_FILESYSTEM_TYPE"><span class="type">G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</span></a> (type of the filesystem).</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If the file does not exist, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-FOUND:CAPS"><code class="literal">G_IO_ERROR_NOT_FOUND</code></a> error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.</p> <div class="refsect3"> <a name="g-file-query-filesystem-info.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attributes</p></td> <td class="parameter_description"><p>an attribute query string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-filesystem-info.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> or <code class="literal">NULL</code> if there was an error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-filesystem-info-async"></a><h3>g_file_query_filesystem_info_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_query_filesystem_info_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attributes</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously gets the requested information about the filesystem that the specified <em class="parameter"><code>file</code></em> is on. The result is a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> object that contains key-value attributes (such as type or size for the file).</p> <p>For more details, see <a class="link" href="GFile.html#g-file-query-filesystem-info" title="g_file_query_filesystem_info ()"><code class="function">g_file_query_filesystem_info()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-query-info-finish" title="g_file_query_info_finish ()"><code class="function">g_file_query_info_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-query-filesystem-info-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attributes</p></td> <td class="parameter_description"><p>an attribute query string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-filesystem-info-finish"></a><h3>g_file_query_filesystem_info_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * g_file_query_filesystem_info_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous filesystem info query. See <a class="link" href="GFile.html#g-file-query-filesystem-info-async" title="g_file_query_filesystem_info_async ()"><code class="function">g_file_query_filesystem_info_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-query-filesystem-info-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-filesystem-info-finish.returns"></a><h4>Returns</h4> <p><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> for given <em class="parameter"><code>file</code></em> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-default-handler"></a><h3>g_file_query_default_handler ()</h3> <pre class="programlisting"><a class="link" href="GAppInfo.html" title="GAppInfo"><span class="returnvalue">GAppInfo</span></a> * g_file_query_default_handler (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Returns the <a class="link" href="GAppInfo.html" title="GAppInfo"><span class="type">GAppInfo</span></a> that is registered as the default application to handle the file specified by <em class="parameter"><code>file</code></em> .</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-query-default-handler.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to open</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-default-handler.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GAppInfo.html" title="GAppInfo"><span class="type">GAppInfo</span></a> if the handle was found, <code class="literal">NULL</code> if there were errors. When you are done with it, release it with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-default-handler-async"></a><h3>g_file_query_default_handler_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_query_default_handler_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Async version of <a class="link" href="GFile.html#g-file-query-default-handler" title="g_file_query_default_handler ()"><code class="function">g_file_query_default_handler()</code></a>.</p> <div class="refsect3"> <a name="g-file-query-default-handler-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to open</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is done. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>data to pass to <em class="parameter"><code>callback</code></em> . </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-60.html#api-index-2.60">2.60</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-query-default-handler-finish"></a><h3>g_file_query_default_handler_finish ()</h3> <pre class="programlisting"><a class="link" href="GAppInfo.html" title="GAppInfo"><span class="returnvalue">GAppInfo</span></a> * g_file_query_default_handler_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes a <a class="link" href="GFile.html#g-file-query-default-handler-async" title="g_file_query_default_handler_async ()"><code class="function">g_file_query_default_handler_async()</code></a> operation.</p> <div class="refsect3"> <a name="g-file-query-default-handler-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to open</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-default-handler-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GAppInfo.html" title="GAppInfo"><span class="type">GAppInfo</span></a> if the handle was found, <code class="literal">NULL</code> if there were errors. When you are done with it, release it with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-60.html#api-index-2.60">2.60</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-measure-disk-usage"></a><h3>g_file_measure_disk_usage ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_measure_disk_usage (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileMeasureFlags" title="enum GFileMeasureFlags"><span class="type">GFileMeasureFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileMeasureProgressCallback" title="GFileMeasureProgressCallback ()"><span class="type">GFileMeasureProgressCallback</span></a> progress_callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> progress_data</code></em>, <em class="parameter"><code><span class="type">guint64</span> *disk_usage</code></em>, <em class="parameter"><code><span class="type">guint64</span> *num_dirs</code></em>, <em class="parameter"><code><span class="type">guint64</span> *num_files</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Recursively measures the disk usage of <em class="parameter"><code>file</code></em> .</p> <p>This is essentially an analog of the 'du' command, but it also reports the number of directories and non-directory files encountered (including things like symbolic links).</p> <p>By default, errors are only reported against the toplevel file itself. Errors found while recursing are silently ignored, unless <a class="link" href="GFile.html#G-FILE-MEASURE-REPORT-ANY-ERROR:CAPS"><code class="literal">G_FILE_MEASURE_REPORT_ANY_ERROR</code></a> is given in <em class="parameter"><code>flags</code></em> .</p> <p>The returned size, <em class="parameter"><code>disk_usage</code></em> , is in bytes and should be formatted with <code class="function">g_format_size()</code> in order to get something reasonable for showing in a user interface.</p> <p><em class="parameter"><code>progress_callback</code></em> and <em class="parameter"><code>progress_data</code></em> can be given to request periodic progress updates while scanning. See the documentation for <a class="link" href="GFile.html#GFileMeasureProgressCallback" title="GFileMeasureProgressCallback ()"><span class="type">GFileMeasureProgressCallback</span></a> for information about when and how the callback will be invoked.</p> <div class="refsect3"> <a name="g-file-measure-disk-usage.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html#GFileMeasureFlags" title="enum GFileMeasureFlags"><span class="type">GFileMeasureFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html#GFileMeasureProgressCallback" title="GFileMeasureProgressCallback ()"><span class="type">GFileMeasureProgressCallback</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_data</p></td> <td class="parameter_description"><p>user_data for <em class="parameter"><code>progress_callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>disk_usage</p></td> <td class="parameter_description"><p>the number of bytes of disk space used. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>num_dirs</p></td> <td class="parameter_description"><p>the number of directories encountered. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>num_files</p></td> <td class="parameter_description"><p>the number of non-directories encountered. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p><code class="literal">NULL</code>, or a pointer to a <code class="literal">NULL</code> <span class="type">GError</span> pointer. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-measure-disk-usage.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if successful, with the out parameters set. <code class="literal">FALSE</code> otherwise, with <em class="parameter"><code>error</code></em> set.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-measure-disk-usage-async"></a><h3>g_file_measure_disk_usage_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_measure_disk_usage_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileMeasureFlags" title="enum GFileMeasureFlags"><span class="type">GFileMeasureFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">gint</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileMeasureProgressCallback" title="GFileMeasureProgressCallback ()"><span class="type">GFileMeasureProgressCallback</span></a> progress_callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> progress_data</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Recursively measures the disk usage of <em class="parameter"><code>file</code></em> .</p> <p>This is the asynchronous version of <a class="link" href="GFile.html#g-file-measure-disk-usage" title="g_file_measure_disk_usage ()"><code class="function">g_file_measure_disk_usage()</code></a>. See there for more information.</p> <div class="refsect3"> <a name="g-file-measure-disk-usage-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html#GFileMeasureFlags" title="enum GFileMeasureFlags"><span class="type">GFileMeasureFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html#GFileMeasureProgressCallback" title="GFileMeasureProgressCallback ()"><span class="type">GFileMeasureProgressCallback</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_data</p></td> <td class="parameter_description"><p>user_data for <em class="parameter"><code>progress_callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when complete. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-measure-disk-usage-finish"></a><h3>g_file_measure_disk_usage_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_measure_disk_usage_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">guint64</span> *disk_usage</code></em>, <em class="parameter"><code><span class="type">guint64</span> *num_dirs</code></em>, <em class="parameter"><code><span class="type">guint64</span> *num_files</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Collects the results from an earlier call to <a class="link" href="GFile.html#g-file-measure-disk-usage-async" title="g_file_measure_disk_usage_async ()"><code class="function">g_file_measure_disk_usage_async()</code></a>. See <a class="link" href="GFile.html#g-file-measure-disk-usage" title="g_file_measure_disk_usage ()"><code class="function">g_file_measure_disk_usage()</code></a> for more information.</p> <div class="refsect3"> <a name="g-file-measure-disk-usage-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> passed to your <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>disk_usage</p></td> <td class="parameter_description"><p>the number of bytes of disk space used. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>num_dirs</p></td> <td class="parameter_description"><p>the number of directories encountered. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>num_files</p></td> <td class="parameter_description"><p>the number of non-directories encountered. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p><code class="literal">NULL</code>, or a pointer to a <code class="literal">NULL</code> <span class="type">GError</span> pointer. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-measure-disk-usage-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if successful, with the out parameters set. <code class="literal">FALSE</code> otherwise, with <em class="parameter"><code>error</code></em> set.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-find-enclosing-mount"></a><h3>g_file_find_enclosing_mount ()</h3> <pre class="programlisting"><a class="link" href="GMount.html" title="GMount"><span class="returnvalue">GMount</span></a> * g_file_find_enclosing_mount (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Gets a <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> for the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p> <p><a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> is returned only for user interesting locations, see <a class="link" href="GVolumeMonitor.html" title="GVolumeMonitor"><span class="type">GVolumeMonitor</span></a>. If the <a class="link" href="GFile.html#GFileIface" title="struct GFileIface"><span class="type">GFileIface</span></a> for <em class="parameter"><code>file</code></em> does not have a <span class="type">mount</span>, <em class="parameter"><code>error</code></em> will be set to <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-FOUND:CAPS"><code class="literal">G_IO_ERROR_NOT_FOUND</code></a> and <code class="literal">NULL</code> <span class="type">will</span> be returned.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-find-enclosing-mount.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-find-enclosing-mount.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> where the <em class="parameter"><code>file</code></em> is located or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-find-enclosing-mount-async"></a><h3>g_file_find_enclosing_mount_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_find_enclosing_mount_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously gets the mount for the file.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-find-enclosing-mount" title="g_file_find_enclosing_mount ()"><code class="function">g_file_find_enclosing_mount()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-find-enclosing-mount-finish" title="g_file_find_enclosing_mount_finish ()"><code class="function">g_file_find_enclosing_mount_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-find-enclosing-mount-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-find-enclosing-mount-finish"></a><h3>g_file_find_enclosing_mount_finish ()</h3> <pre class="programlisting"><a class="link" href="GMount.html" title="GMount"><span class="returnvalue">GMount</span></a> * g_file_find_enclosing_mount_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous find mount request. See <a class="link" href="GFile.html#g-file-find-enclosing-mount-async" title="g_file_find_enclosing_mount_async ()"><code class="function">g_file_find_enclosing_mount_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-find-enclosing-mount-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-find-enclosing-mount-finish.returns"></a><h4>Returns</h4> <p><a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> for given <em class="parameter"><code>file</code></em> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-enumerate-children"></a><h3>g_file_enumerate_children ()</h3> <pre class="programlisting"><a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="returnvalue">GFileEnumerator</span></a> * g_file_enumerate_children (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attributes</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Gets the requested information about the files in a directory. The result is a <a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="type">GFileEnumerator</span></a> object that will give out <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> objects for all the files in the directory.</p> <p>The <em class="parameter"><code>attributes</code></em> value is a string that specifies the file attributes that should be gathered. It is not an error if it's not possible to read a particular requested attribute from a file - it just won't be set. <em class="parameter"><code>attributes</code></em> should be a comma-separated list of attributes or attribute wildcards. The wildcard "*" means all attributes, and a wildcard like "standard::*" means all attributes in the standard namespace. An example attribute query be "standard::*,owner::user". The standard attributes are available as defines, like <a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-STANDARD-NAME:CAPS" title="G_FILE_ATTRIBUTE_STANDARD_NAME"><span class="type">G_FILE_ATTRIBUTE_STANDARD_NAME</span></a>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If the file does not exist, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-FOUND:CAPS"><code class="literal">G_IO_ERROR_NOT_FOUND</code></a> error will be returned. If the file is not a directory, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-DIRECTORY:CAPS"><code class="literal">G_IO_ERROR_NOT_DIRECTORY</code></a> error will be returned. Other errors are possible too.</p> <div class="refsect3"> <a name="g-file-enumerate-children.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attributes</p></td> <td class="parameter_description"><p>an attribute query string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p><span class="type">GError</span> for error reporting</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-enumerate-children.returns"></a><h4>Returns</h4> <p>A <a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="type">GFileEnumerator</span></a> if successful, <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-enumerate-children-async"></a><h3>g_file_enumerate_children_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_enumerate_children_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attributes</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously gets the requested information about the files in a directory. The result is a <a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="type">GFileEnumerator</span></a> object that will give out <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> objects for all the files in the directory.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-enumerate-children" title="g_file_enumerate_children ()"><code class="function">g_file_enumerate_children()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-enumerate-children-finish" title="g_file_enumerate_children_finish ()"><code class="function">g_file_enumerate_children_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-enumerate-children-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attributes</p></td> <td class="parameter_description"><p>an attribute query string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-enumerate-children-finish"></a><h3>g_file_enumerate_children_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="returnvalue">GFileEnumerator</span></a> * g_file_enumerate_children_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an async enumerate children operation. See <a class="link" href="GFile.html#g-file-enumerate-children-async" title="g_file_enumerate_children_async ()"><code class="function">g_file_enumerate_children_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-enumerate-children-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-enumerate-children-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="type">GFileEnumerator</span></a> or <code class="literal">NULL</code> if an error occurred. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-display-name"></a><h3>g_file_set_display_name ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_set_display_name (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *display_name</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Renames <em class="parameter"><code>file</code></em> to the specified display name.</p> <p>The display name is converted from UTF-8 to the correct encoding for the target filesystem if possible and the <em class="parameter"><code>file</code></em> is renamed to this.</p> <p>If you want to implement a rename operation in the user interface the edit name (<a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-STANDARD-EDIT-NAME:CAPS" title="G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME"><span class="type">G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</span></a>) should be used as the initial value in the rename widget, and then the result after editing should be passed to <a class="link" href="GFile.html#g-file-set-display-name" title="g_file_set_display_name ()"><code class="function">g_file_set_display_name()</code></a>.</p> <p>On success the resulting converted filename is returned.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-set-display-name.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>display_name</p></td> <td class="parameter_description"><p>a string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-display-name.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> specifying what <em class="parameter"><code>file</code></em> was renamed to, or <code class="literal">NULL</code> if there was an error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-display-name-async"></a><h3>g_file_set_display_name_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_set_display_name_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *display_name</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously sets the display name for a given <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-set-display-name" title="g_file_set_display_name ()"><code class="function">g_file_set_display_name()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-set-display-name-finish" title="g_file_set_display_name_finish ()"><code class="function">g_file_set_display_name_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-set-display-name-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>display_name</p></td> <td class="parameter_description"><p>a string</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-display-name-finish"></a><h3>g_file_set_display_name_finish ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_set_display_name_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes setting a display name started with <a class="link" href="GFile.html#g-file-set-display-name-async" title="g_file_set_display_name_async ()"><code class="function">g_file_set_display_name_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-set-display-name-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-display-name-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-delete"></a><h3>g_file_delete ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_delete (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Deletes a file. If the <em class="parameter"><code>file</code></em> is a directory, it will only be deleted if it is empty. This has the same semantics as <code class="function">g_unlink()</code>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>Virtual: delete_file</p> <div class="refsect3"> <a name="g-file-delete.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-delete.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the file was deleted. <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-delete-async"></a><h3>g_file_delete_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_delete_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously delete a file. If the <em class="parameter"><code>file</code></em> is a directory, it will only be deleted if it is empty. This has the same semantics as <code class="function">g_unlink()</code>.</p> <p>Virtual: delete_file_async</p> <div class="refsect3"> <a name="g-file-delete-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-delete-finish"></a><h3>g_file_delete_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_delete_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes deleting a file started with <a class="link" href="GFile.html#g-file-delete-async" title="g_file_delete_async ()"><code class="function">g_file_delete_async()</code></a>.</p> <p>Virtual: delete_file_finish</p> <div class="refsect3"> <a name="g-file-delete-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-delete-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the file was deleted. <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-trash"></a><h3>g_file_trash ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_trash (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Sends <em class="parameter"><code>file</code></em> to the "Trashcan", if possible. This is similar to deleting it, but the user can recover it before emptying the trashcan. Not all file systems support trashing, so this call can return the <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-SUPPORTED:CAPS"><code class="literal">G_IO_ERROR_NOT_SUPPORTED</code></a> error.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>Virtual: trash</p> <div class="refsect3"> <a name="g-file-trash.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to send to trash</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-trash.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> on successful trash, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-trash-async"></a><h3>g_file_trash_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_trash_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously sends <em class="parameter"><code>file</code></em> to the Trash location, if possible.</p> <p>Virtual: trash_async</p> <div class="refsect3"> <a name="g-file-trash-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-trash-finish"></a><h3>g_file_trash_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_trash_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous file trashing operation, started with <a class="link" href="GFile.html#g-file-trash-async" title="g_file_trash_async ()"><code class="function">g_file_trash_async()</code></a>.</p> <p>Virtual: trash_finish</p> <div class="refsect3"> <a name="g-file-trash-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-trash-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> on successful trash, <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-copy"></a><h3>g_file_copy ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_copy (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *source</code></em>, <em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *destination</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCopyFlags" title="enum GFileCopyFlags"><span class="type">GFileCopyFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileProgressCallback" title="GFileProgressCallback ()"><span class="type">GFileProgressCallback</span></a> progress_callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> progress_callback_data</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Copies the file <em class="parameter"><code>source</code></em> to the location specified by <em class="parameter"><code>destination</code></em> . Can not handle recursive copies of directories.</p> <p>If the flag <a class="link" href="GFile.html#G-FILE-COPY-OVERWRITE:CAPS"><span class="type">G_FILE_COPY_OVERWRITE</span></a> is specified an already existing <em class="parameter"><code>destination</code></em> file is overwritten.</p> <p>If the flag <a class="link" href="GFile.html#G-FILE-COPY-NOFOLLOW-SYMLINKS:CAPS"><span class="type">G_FILE_COPY_NOFOLLOW_SYMLINKS</span></a> is specified then symlinks will be copied as symlinks, otherwise the target of the <em class="parameter"><code>source</code></em> symlink will be copied.</p> <p>If the flag <a class="link" href="GFile.html#G-FILE-COPY-ALL-METADATA:CAPS"><span class="type">G_FILE_COPY_ALL_METADATA</span></a> is specified then all the metadata that is possible to copy is copied, not just the default subset (which, for instance, does not include the owner, see <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a>).</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If <em class="parameter"><code>progress_callback</code></em> is not <code class="literal">NULL</code>, then the operation can be monitored by setting this to a <a class="link" href="GFile.html#GFileProgressCallback" title="GFileProgressCallback ()"><span class="type">GFileProgressCallback</span></a> function. <em class="parameter"><code>progress_callback_data</code></em> will be passed to this function. It is guaranteed that this callback will be called after all data has been transferred with the total number of bytes copied during the operation.</p> <p>If the <em class="parameter"><code>source</code></em> file does not exist, then the <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-FOUND:CAPS"><code class="literal">G_IO_ERROR_NOT_FOUND</code></a> error is returned, independent on the status of the <em class="parameter"><code>destination</code></em> .</p> <p>If <a class="link" href="GFile.html#G-FILE-COPY-OVERWRITE:CAPS"><span class="type">G_FILE_COPY_OVERWRITE</span></a> is not specified and the target exists, then the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-EXISTS:CAPS"><code class="literal">G_IO_ERROR_EXISTS</code></a> is returned.</p> <p>If trying to overwrite a file over a directory, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-IS-DIRECTORY:CAPS"><code class="literal">G_IO_ERROR_IS_DIRECTORY</code></a> error is returned. If trying to overwrite a directory with a directory the <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-MERGE:CAPS"><code class="literal">G_IO_ERROR_WOULD_MERGE</code></a> error is returned.</p> <p>If the source is a directory and the target does not exist, or <a class="link" href="GFile.html#G-FILE-COPY-OVERWRITE:CAPS"><span class="type">G_FILE_COPY_OVERWRITE</span></a> is specified and the target is a file, then the <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-RECURSE:CAPS"><code class="literal">G_IO_ERROR_WOULD_RECURSE</code></a> error is returned.</p> <p>If you are interested in copying the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> object itself (not the on-disk file), see <a class="link" href="GFile.html#g-file-dup" title="g_file_dup ()"><code class="function">g_file_dup()</code></a>.</p> <div class="refsect3"> <a name="g-file-copy.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>source</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>destination</p></td> <td class="parameter_description"><p>destination <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>set of <a class="link" href="GFile.html#GFileCopyFlags" title="enum GFileCopyFlags"><span class="type">GFileCopyFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_callback</p></td> <td class="parameter_description"><p>function to callback with progress information, or <code class="literal">NULL</code> if progress information is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_callback_data</p></td> <td class="parameter_description"><p>user data to pass to <em class="parameter"><code>progress_callback</code></em> . </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p><span class="type">GError</span> to set on error, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-copy.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-copy-async"></a><h3>g_file_copy_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_copy_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *source</code></em>, <em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *destination</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCopyFlags" title="enum GFileCopyFlags"><span class="type">GFileCopyFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileProgressCallback" title="GFileProgressCallback ()"><span class="type">GFileProgressCallback</span></a> progress_callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> progress_callback_data</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Copies the file <em class="parameter"><code>source</code></em> to the location specified by <em class="parameter"><code>destination</code></em> asynchronously. For details of the behaviour, see <a class="link" href="GFile.html#g-file-copy" title="g_file_copy ()"><code class="function">g_file_copy()</code></a>.</p> <p>If <em class="parameter"><code>progress_callback</code></em> is not <code class="literal">NULL</code>, then that function that will be called just like in <a class="link" href="GFile.html#g-file-copy" title="g_file_copy ()"><code class="function">g_file_copy()</code></a>. The callback will run in the default main context of the thread calling <a class="link" href="GFile.html#g-file-copy-async" title="g_file_copy_async ()"><code class="function">g_file_copy_async()</code></a> — the same context as <em class="parameter"><code>callback</code></em> is run in.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-copy-finish" title="g_file_copy_finish ()"><code class="function">g_file_copy_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-copy-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>source</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>destination</p></td> <td class="parameter_description"><p>destination <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>set of <a class="link" href="GFile.html#GFileCopyFlags" title="enum GFileCopyFlags"><span class="type">GFileCopyFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_callback</p></td> <td class="parameter_description"><p>function to callback with progress information, or <code class="literal">NULL</code> if progress information is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="The callback is valid until the GDestroyNotify argument is called."><span class="acronym">scope notified</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_callback_data</p></td> <td class="parameter_description"><p>user data to pass to <em class="parameter"><code>progress_callback</code></em> . </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym> progress_callback][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym> callback]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-copy-finish"></a><h3>g_file_copy_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_copy_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes copying the file started with <a class="link" href="GFile.html#g-file-copy-async" title="g_file_copy_async ()"><code class="function">g_file_copy_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-copy-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-copy-finish.returns"></a><h4>Returns</h4> <p> a <code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> on error.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-move"></a><h3>g_file_move ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_move (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *source</code></em>, <em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *destination</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCopyFlags" title="enum GFileCopyFlags"><span class="type">GFileCopyFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileProgressCallback" title="GFileProgressCallback ()"><span class="type">GFileProgressCallback</span></a> progress_callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> progress_callback_data</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Tries to move the file or directory <em class="parameter"><code>source</code></em> to the location specified by <em class="parameter"><code>destination</code></em> . If native move operations are supported then this is used, otherwise a copy + delete fallback is used. The native implementation may support moving directories (for instance on moves inside the same filesystem), but the fallback code does not.</p> <p>If the flag <a class="link" href="GFile.html#G-FILE-COPY-OVERWRITE:CAPS"><span class="type">G_FILE_COPY_OVERWRITE</span></a> is specified an already existing <em class="parameter"><code>destination</code></em> file is overwritten.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If <em class="parameter"><code>progress_callback</code></em> is not <code class="literal">NULL</code>, then the operation can be monitored by setting this to a <a class="link" href="GFile.html#GFileProgressCallback" title="GFileProgressCallback ()"><span class="type">GFileProgressCallback</span></a> function. <em class="parameter"><code>progress_callback_data</code></em> will be passed to this function. It is guaranteed that this callback will be called after all data has been transferred with the total number of bytes copied during the operation.</p> <p>If the <em class="parameter"><code>source</code></em> file does not exist, then the <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-FOUND:CAPS"><code class="literal">G_IO_ERROR_NOT_FOUND</code></a> error is returned, independent on the status of the <em class="parameter"><code>destination</code></em> .</p> <p>If <a class="link" href="GFile.html#G-FILE-COPY-OVERWRITE:CAPS"><span class="type">G_FILE_COPY_OVERWRITE</span></a> is not specified and the target exists, then the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-EXISTS:CAPS"><code class="literal">G_IO_ERROR_EXISTS</code></a> is returned.</p> <p>If trying to overwrite a file over a directory, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-IS-DIRECTORY:CAPS"><code class="literal">G_IO_ERROR_IS_DIRECTORY</code></a> error is returned. If trying to overwrite a directory with a directory the <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-MERGE:CAPS"><code class="literal">G_IO_ERROR_WOULD_MERGE</code></a> error is returned.</p> <p>If the source is a directory and the target does not exist, or <a class="link" href="GFile.html#G-FILE-COPY-OVERWRITE:CAPS"><span class="type">G_FILE_COPY_OVERWRITE</span></a> is specified and the target is a file, then the <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-RECURSE:CAPS"><code class="literal">G_IO_ERROR_WOULD_RECURSE</code></a> error may be returned (if the native move operation isn't available).</p> <div class="refsect3"> <a name="g-file-move.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>source</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> pointing to the source location</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>destination</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> pointing to the destination location</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>set of <a class="link" href="GFile.html#GFileCopyFlags" title="enum GFileCopyFlags"><span class="type">GFileCopyFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_callback</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html#GFileProgressCallback" title="GFileProgressCallback ()"><span class="type">GFileProgressCallback</span></a> function for updates. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>progress_callback_data</p></td> <td class="parameter_description"><p>gpointer to user data for the callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p><span class="type">GError</span> for returning error conditions, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-move.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> on successful move, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-make-directory"></a><h3>g_file_make_directory ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_make_directory (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Creates a directory. Note that this will only create a child directory of the immediate parent directory of the path or URI given by the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>. To recursively create directories, see <a class="link" href="GFile.html#g-file-make-directory-with-parents" title="g_file_make_directory_with_parents ()"><code class="function">g_file_make_directory_with_parents()</code></a>. This function will fail if the parent directory does not exist, setting <em class="parameter"><code>error</code></em> to <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-FOUND:CAPS"><code class="literal">G_IO_ERROR_NOT_FOUND</code></a>. If the file system doesn't support creating directories, this function will fail, setting <em class="parameter"><code>error</code></em> to <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-SUPPORTED:CAPS"><code class="literal">G_IO_ERROR_NOT_SUPPORTED</code></a>.</p> <p>For a local <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> the newly created directory will have the default (current) ownership and permissions of the current process.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-make-directory.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-make-directory.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> on successful creation, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-make-directory-async"></a><h3>g_file_make_directory_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_make_directory_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously creates a directory.</p> <p>Virtual: make_directory_async</p> <div class="refsect3"> <a name="g-file-make-directory-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-make-directory-finish"></a><h3>g_file_make_directory_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_make_directory_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous directory creation, started with <a class="link" href="GFile.html#g-file-make-directory-async" title="g_file_make_directory_async ()"><code class="function">g_file_make_directory_async()</code></a>.</p> <p>Virtual: make_directory_finish</p> <div class="refsect3"> <a name="g-file-make-directory-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-make-directory-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> on successful directory creation, <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-make-directory-with-parents"></a><h3>g_file_make_directory_with_parents ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_make_directory_with_parents (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Creates a directory and any parent directories that may not exist similar to 'mkdir -p'. If the file system does not support creating directories, this function will fail, setting <em class="parameter"><code>error</code></em> to <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-SUPPORTED:CAPS"><code class="literal">G_IO_ERROR_NOT_SUPPORTED</code></a>. If the directory itself already exists, this function will fail setting <em class="parameter"><code>error</code></em> to <a class="link" href="gio-GIOError.html#G-IO-ERROR-EXISTS:CAPS"><code class="literal">G_IO_ERROR_EXISTS</code></a>, unlike the similar <code class="function">g_mkdir_with_parents()</code>.</p> <p>For a local <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> the newly created directories will have the default (current) ownership and permissions of the current process.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-make-directory-with-parents.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-make-directory-with-parents.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if all directories have been successfully created, <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-18.html#api-index-2.18">2.18</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-make-symbolic-link"></a><h3>g_file_make_symbolic_link ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_make_symbolic_link (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *symlink_value</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Creates a symbolic link named <em class="parameter"><code>file</code></em> which contains the string <em class="parameter"><code>symlink_value</code></em> .</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-make-symbolic-link.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> with the name of the symlink to create</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>symlink_value</p></td> <td class="parameter_description"><p>a string with the path for the target of the new symlink. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-make-symbolic-link.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> on the creation of a new symlink, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-settable-attributes"></a><h3>g_file_query_settable_attributes ()</h3> <pre class="programlisting"><a class="link" href="gio-GFileAttribute.html#GFileAttributeInfoList"><span class="returnvalue">GFileAttributeInfoList</span></a> * g_file_query_settable_attributes (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Obtain the list of settable attributes for the file.</p> <p>Returns the type and full attribute name of all the attributes that can be set on this file. This doesn't mean setting it will always succeed though, you might get an access failure, or some specific file may not support a specific attribute.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-query-settable-attributes.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-settable-attributes.returns"></a><h4>Returns</h4> <p> a <a class="link" href="gio-GFileAttribute.html#GFileAttributeInfoList"><span class="type">GFileAttributeInfoList</span></a> describing the settable attributes. When you are done with it, release it with <a class="link" href="gio-GFileAttribute.html#g-file-attribute-info-list-unref" title="g_file_attribute_info_list_unref ()"><code class="function">g_file_attribute_info_list_unref()</code></a></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-query-writable-namespaces"></a><h3>g_file_query_writable_namespaces ()</h3> <pre class="programlisting"><a class="link" href="gio-GFileAttribute.html#GFileAttributeInfoList"><span class="returnvalue">GFileAttributeInfoList</span></a> * g_file_query_writable_namespaces (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Obtain the list of attribute namespaces where new attributes can be created by a user. An example of this is extended attributes (in the "xattr" namespace).</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-query-writable-namespaces.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-query-writable-namespaces.returns"></a><h4>Returns</h4> <p> a <a class="link" href="gio-GFileAttribute.html#GFileAttributeInfoList"><span class="type">GFileAttributeInfoList</span></a> describing the writable namespaces. When you are done with it, release it with <a class="link" href="gio-GFileAttribute.html#g-file-attribute-info-list-unref" title="g_file_attribute_info_list_unref ()"><code class="function">g_file_attribute_info_list_unref()</code></a></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attribute"></a><h3>g_file_set_attribute ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_set_attribute (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attribute</code></em>, <em class="parameter"><code><a class="link" href="gio-GFileAttribute.html#GFileAttributeType" title="enum GFileAttributeType"><span class="type">GFileAttributeType</span></a> type</code></em>, <em class="parameter"><code><span class="type">gpointer</span> value_p</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Sets an attribute in the file with attribute name <em class="parameter"><code>attribute</code></em> to <em class="parameter"><code>value_p</code></em> .</p> <p>Some attributes can be unset by setting <em class="parameter"><code>type</code></em> to <a class="link" href="gio-GFileAttribute.html#G-FILE-ATTRIBUTE-TYPE-INVALID:CAPS"><code class="literal">G_FILE_ATTRIBUTE_TYPE_INVALID</code></a> and <em class="parameter"><code>value_p</code></em> to <code class="literal">NULL</code>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-set-attribute.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attribute</p></td> <td class="parameter_description"><p>a string containing the attribute's name</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>The type of the attribute</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value_p</p></td> <td class="parameter_description"><p>a pointer to the value (or the pointer itself if the type is a pointer type). </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-attribute.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the attribute was set, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attributes-from-info"></a><h3>g_file_set_attributes_from_info ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_set_attributes_from_info (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> *info</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Tries to set all attributes in the <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> on the target values, not stopping on the first error.</p> <p>If there is any error during this operation then <em class="parameter"><code>error</code></em> will be set to the first error. Error on particular fields are flagged by setting the "status" field in the attribute value to <a class="link" href="gio-GFileAttribute.html#G-FILE-ATTRIBUTE-STATUS-ERROR-SETTING:CAPS"><code class="literal">G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING</code></a>, which means you can also detect further errors.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-set-attributes-from-info.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>info</p></td> <td class="parameter_description"><p>a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-attributes-from-info.returns"></a><h4>Returns</h4> <p> <code class="literal">FALSE</code> if there was any error, <code class="literal">TRUE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attributes-async"></a><h3>g_file_set_attributes_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_set_attributes_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> *info</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously sets the attributes of <em class="parameter"><code>file</code></em> with <em class="parameter"><code>info</code></em> .</p> <p>For more details, see <a class="link" href="GFile.html#g-file-set-attributes-from-info" title="g_file_set_attributes_from_info ()"><code class="function">g_file_set_attributes_from_info()</code></a>, which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-set-attributes-finish" title="g_file_set_attributes_finish ()"><code class="function">g_file_set_attributes_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-set-attributes-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>info</p></td> <td class="parameter_description"><p>a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>a <span class="type">gpointer</span>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attributes-finish"></a><h3>g_file_set_attributes_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_set_attributes_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> **info</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes setting an attribute started in <a class="link" href="GFile.html#g-file-set-attributes-async" title="g_file_set_attributes_async ()"><code class="function">g_file_set_attributes_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-set-attributes-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>info</p></td> <td class="parameter_description"><p>a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-attributes-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the attributes were set correctly, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attribute-string"></a><h3>g_file_set_attribute_string ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_set_attribute_string (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attribute</code></em>, <em class="parameter"><code>const <span class="type">char</span> *value</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Sets <em class="parameter"><code>attribute</code></em> of type <a class="link" href="gio-GFileAttribute.html#G-FILE-ATTRIBUTE-TYPE-STRING:CAPS"><code class="literal">G_FILE_ATTRIBUTE_TYPE_STRING</code></a> to <em class="parameter"><code>value</code></em> . If <em class="parameter"><code>attribute</code></em> is of a different type, this operation will fail.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-set-attribute-string.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attribute</p></td> <td class="parameter_description"><p>a string containing the attribute's name</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a string containing the attribute's value</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-attribute-string.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>attribute</code></em> was successfully set, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attribute-byte-string"></a><h3>g_file_set_attribute_byte_string ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_set_attribute_byte_string (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attribute</code></em>, <em class="parameter"><code>const <span class="type">char</span> *value</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Sets <em class="parameter"><code>attribute</code></em> of type <a class="link" href="gio-GFileAttribute.html#G-FILE-ATTRIBUTE-TYPE-BYTE-STRING:CAPS"><code class="literal">G_FILE_ATTRIBUTE_TYPE_BYTE_STRING</code></a> to <em class="parameter"><code>value</code></em> . If <em class="parameter"><code>attribute</code></em> is of a different type, this operation will fail, returning <code class="literal">FALSE</code>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-set-attribute-byte-string.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attribute</p></td> <td class="parameter_description"><p>a string containing the attribute's name</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a string containing the attribute's new value</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-attribute-byte-string.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>attribute</code></em> was successfully set to <em class="parameter"><code>value</code></em> in the <em class="parameter"><code>file</code></em> , <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attribute-uint32"></a><h3>g_file_set_attribute_uint32 ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_set_attribute_uint32 (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attribute</code></em>, <em class="parameter"><code><span class="type">guint32</span> value</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Sets <em class="parameter"><code>attribute</code></em> of type <a class="link" href="gio-GFileAttribute.html#G-FILE-ATTRIBUTE-TYPE-UINT32:CAPS"><code class="literal">G_FILE_ATTRIBUTE_TYPE_UINT32</code></a> to <em class="parameter"><code>value</code></em> . If <em class="parameter"><code>attribute</code></em> is of a different type, this operation will fail.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-set-attribute-uint32.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attribute</p></td> <td class="parameter_description"><p>a string containing the attribute's name</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a <span class="type">guint32</span> containing the attribute's new value</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-attribute-uint32.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>attribute</code></em> was successfully set to <em class="parameter"><code>value</code></em> in the <em class="parameter"><code>file</code></em> , <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attribute-int32"></a><h3>g_file_set_attribute_int32 ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_set_attribute_int32 (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attribute</code></em>, <em class="parameter"><code><span class="type">gint32</span> value</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Sets <em class="parameter"><code>attribute</code></em> of type <a class="link" href="gio-GFileAttribute.html#G-FILE-ATTRIBUTE-TYPE-INT32:CAPS"><code class="literal">G_FILE_ATTRIBUTE_TYPE_INT32</code></a> to <em class="parameter"><code>value</code></em> . If <em class="parameter"><code>attribute</code></em> is of a different type, this operation will fail.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-set-attribute-int32.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attribute</p></td> <td class="parameter_description"><p>a string containing the attribute's name</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a <span class="type">gint32</span> containing the attribute's new value</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-attribute-int32.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>attribute</code></em> was successfully set to <em class="parameter"><code>value</code></em> in the <em class="parameter"><code>file</code></em> , <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attribute-uint64"></a><h3>g_file_set_attribute_uint64 ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_set_attribute_uint64 (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attribute</code></em>, <em class="parameter"><code><span class="type">guint64</span> value</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Sets <em class="parameter"><code>attribute</code></em> of type <a class="link" href="gio-GFileAttribute.html#G-FILE-ATTRIBUTE-TYPE-UINT64:CAPS"><code class="literal">G_FILE_ATTRIBUTE_TYPE_UINT64</code></a> to <em class="parameter"><code>value</code></em> . If <em class="parameter"><code>attribute</code></em> is of a different type, this operation will fail.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-set-attribute-uint64.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attribute</p></td> <td class="parameter_description"><p>a string containing the attribute's name</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a <span class="type">guint64</span> containing the attribute's new value</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-attribute-uint64.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>attribute</code></em> was successfully set to <em class="parameter"><code>value</code></em> in the <em class="parameter"><code>file</code></em> , <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-set-attribute-int64"></a><h3>g_file_set_attribute_int64 ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_set_attribute_int64 (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *attribute</code></em>, <em class="parameter"><code><span class="type">gint64</span> value</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Sets <em class="parameter"><code>attribute</code></em> of type <a class="link" href="gio-GFileAttribute.html#G-FILE-ATTRIBUTE-TYPE-INT64:CAPS"><code class="literal">G_FILE_ATTRIBUTE_TYPE_INT64</code></a> to <em class="parameter"><code>value</code></em> . If <em class="parameter"><code>attribute</code></em> is of a different type, this operation will fail.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-set-attribute-int64.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>attribute</p></td> <td class="parameter_description"><p>a string containing the attribute's name</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a <span class="type">guint64</span> containing the attribute's new value</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html#GFileQueryInfoFlags" title="enum GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-set-attribute-int64.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>attribute</code></em> was successfully set, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-mount-mountable"></a><h3>g_file_mount_mountable ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_mount_mountable (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GMount.html#GMountMountFlags" title="enum GMountMountFlags"><span class="type">GMountMountFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a> *mount_operation</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Mounts a file of type G_FILE_TYPE_MOUNTABLE. Using <em class="parameter"><code>mount_operation</code></em> , you can request callbacks when, for instance, passwords are needed during authentication.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-mount-mountable-finish" title="g_file_mount_mountable_finish ()"><code class="function">g_file_mount_mountable_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-mount-mountable.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting the operation</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>mount_operation</p></td> <td class="parameter_description"><p>a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a>, or <code class="literal">NULL</code> to avoid user interaction. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-mount-mountable-finish"></a><h3>g_file_mount_mountable_finish ()</h3> <pre class="programlisting"><a class="link" href="GFile.html" title="GFile"><span class="returnvalue">GFile</span></a> * g_file_mount_mountable_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes a mount operation. See <a class="link" href="GFile.html#g-file-mount-mountable" title="g_file_mount_mountable ()"><code class="function">g_file_mount_mountable()</code></a> for details.</p> <p>Finish an asynchronous mount operation that was started with <a class="link" href="GFile.html#g-file-mount-mountable" title="g_file_mount_mountable ()"><code class="function">g_file_mount_mountable()</code></a>.</p> <div class="refsect3"> <a name="g-file-mount-mountable-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-mount-mountable-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-unmount-mountable"></a><h3>g_file_unmount_mountable ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_unmount_mountable (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GMount.html#GMountUnmountFlags" title="enum GMountUnmountFlags"><span class="type">GMountUnmountFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <div class="warning"> <p><code class="literal">g_file_unmount_mountable</code> has been deprecated since version 2.22 and should not be used in newly-written code.</p> <p>Use <a class="link" href="GFile.html#g-file-unmount-mountable-with-operation" title="g_file_unmount_mountable_with_operation ()"><code class="function">g_file_unmount_mountable_with_operation()</code></a> instead.</p> </div> <p>Unmounts a file of type G_FILE_TYPE_MOUNTABLE.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-unmount-mountable-finish" title="g_file_unmount_mountable_finish ()"><code class="function">g_file_unmount_mountable_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-unmount-mountable.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting the operation</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-unmount-mountable-finish"></a><h3>g_file_unmount_mountable_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_unmount_mountable_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <div class="warning"> <p><code class="literal">g_file_unmount_mountable_finish</code> has been deprecated since version 2.22 and should not be used in newly-written code.</p> <p>Use <a class="link" href="GFile.html#g-file-unmount-mountable-with-operation-finish" title="g_file_unmount_mountable_with_operation_finish ()"><code class="function">g_file_unmount_mountable_with_operation_finish()</code></a> instead.</p> </div> <p>Finishes an unmount operation, see <a class="link" href="GFile.html#g-file-unmount-mountable" title="g_file_unmount_mountable ()"><code class="function">g_file_unmount_mountable()</code></a> for details.</p> <p>Finish an asynchronous unmount operation that was started with <a class="link" href="GFile.html#g-file-unmount-mountable" title="g_file_unmount_mountable ()"><code class="function">g_file_unmount_mountable()</code></a>.</p> <div class="refsect3"> <a name="g-file-unmount-mountable-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-unmount-mountable-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the operation finished successfully. <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-unmount-mountable-with-operation"></a><h3>g_file_unmount_mountable_with_operation ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_unmount_mountable_with_operation (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GMount.html#GMountUnmountFlags" title="enum GMountUnmountFlags"><span class="type">GMountUnmountFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a> *mount_operation</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Unmounts a file of type <a class="link" href="GFileInfo.html#G-FILE-TYPE-MOUNTABLE:CAPS"><span class="type">G_FILE_TYPE_MOUNTABLE</span></a>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-unmount-mountable-finish" title="g_file_unmount_mountable_finish ()"><code class="function">g_file_unmount_mountable_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-unmount-mountable-with-operation.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting the operation</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>mount_operation</p></td> <td class="parameter_description"><p>a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a>, or <code class="literal">NULL</code> to avoid user interaction. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-unmount-mountable-with-operation-finish"></a><h3>g_file_unmount_mountable_with_operation_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_unmount_mountable_with_operation_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an unmount operation, see <a class="link" href="GFile.html#g-file-unmount-mountable-with-operation" title="g_file_unmount_mountable_with_operation ()"><code class="function">g_file_unmount_mountable_with_operation()</code></a> for details.</p> <p>Finish an asynchronous unmount operation that was started with <a class="link" href="GFile.html#g-file-unmount-mountable-with-operation" title="g_file_unmount_mountable_with_operation ()"><code class="function">g_file_unmount_mountable_with_operation()</code></a>.</p> <div class="refsect3"> <a name="g-file-unmount-mountable-with-operation-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-unmount-mountable-with-operation-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the operation finished successfully. <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-eject-mountable"></a><h3>g_file_eject_mountable ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_eject_mountable (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GMount.html#GMountUnmountFlags" title="enum GMountUnmountFlags"><span class="type">GMountUnmountFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <div class="warning"> <p><code class="literal">g_file_eject_mountable</code> has been deprecated since version 2.22 and should not be used in newly-written code.</p> <p>Use <a class="link" href="GFile.html#g-file-eject-mountable-with-operation" title="g_file_eject_mountable_with_operation ()"><code class="function">g_file_eject_mountable_with_operation()</code></a> instead.</p> </div> <p>Starts an asynchronous eject on a mountable. When this operation has completed, <em class="parameter"><code>callback</code></em> will be called with <em class="parameter"><code>user_user</code></em> data, and the operation can be finalized with <a class="link" href="GFile.html#g-file-eject-mountable-finish" title="g_file_eject_mountable_finish ()"><code class="function">g_file_eject_mountable_finish()</code></a>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-eject-mountable.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting the operation</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-eject-mountable-finish"></a><h3>g_file_eject_mountable_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_eject_mountable_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <div class="warning"> <p><code class="literal">g_file_eject_mountable_finish</code> has been deprecated since version 2.22 and should not be used in newly-written code.</p> <p>Use <a class="link" href="GFile.html#g-file-eject-mountable-with-operation-finish" title="g_file_eject_mountable_with_operation_finish ()"><code class="function">g_file_eject_mountable_with_operation_finish()</code></a> instead.</p> </div> <p>Finishes an asynchronous eject operation started by <a class="link" href="GFile.html#g-file-eject-mountable" title="g_file_eject_mountable ()"><code class="function">g_file_eject_mountable()</code></a>.</p> <div class="refsect3"> <a name="g-file-eject-mountable-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-eject-mountable-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>file</code></em> was ejected successfully. <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-eject-mountable-with-operation"></a><h3>g_file_eject_mountable_with_operation ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_eject_mountable_with_operation (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GMount.html#GMountUnmountFlags" title="enum GMountUnmountFlags"><span class="type">GMountUnmountFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a> *mount_operation</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Starts an asynchronous eject on a mountable. When this operation has completed, <em class="parameter"><code>callback</code></em> will be called with <em class="parameter"><code>user_user</code></em> data, and the operation can be finalized with <a class="link" href="GFile.html#g-file-eject-mountable-with-operation-finish" title="g_file_eject_mountable_with_operation_finish ()"><code class="function">g_file_eject_mountable_with_operation_finish()</code></a>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-eject-mountable-with-operation.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting the operation</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>mount_operation</p></td> <td class="parameter_description"><p>a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a>, or <code class="literal">NULL</code> to avoid user interaction. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-eject-mountable-with-operation-finish"></a><h3>g_file_eject_mountable_with_operation_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_eject_mountable_with_operation_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous eject operation started by <a class="link" href="GFile.html#g-file-eject-mountable-with-operation" title="g_file_eject_mountable_with_operation ()"><code class="function">g_file_eject_mountable_with_operation()</code></a>.</p> <div class="refsect3"> <a name="g-file-eject-mountable-with-operation-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-eject-mountable-with-operation-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>file</code></em> was ejected successfully. <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-start-mountable"></a><h3>g_file_start_mountable ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_start_mountable (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GDrive.html#GDriveStartFlags" title="enum GDriveStartFlags"><span class="type">GDriveStartFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a> *start_operation</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Starts a file of type <a class="link" href="GFileInfo.html#G-FILE-TYPE-MOUNTABLE:CAPS"><span class="type">G_FILE_TYPE_MOUNTABLE</span></a>. Using <em class="parameter"><code>start_operation</code></em> , you can request callbacks when, for instance, passwords are needed during authentication.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-mount-mountable-finish" title="g_file_mount_mountable_finish ()"><code class="function">g_file_mount_mountable_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-start-mountable.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting the operation</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>start_operation</p></td> <td class="parameter_description"><p>a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a>, or <code class="literal">NULL</code> to avoid user interaction. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-start-mountable-finish"></a><h3>g_file_start_mountable_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_start_mountable_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes a start operation. See <a class="link" href="GFile.html#g-file-start-mountable" title="g_file_start_mountable ()"><code class="function">g_file_start_mountable()</code></a> for details.</p> <p>Finish an asynchronous start operation that was started with <a class="link" href="GFile.html#g-file-start-mountable" title="g_file_start_mountable ()"><code class="function">g_file_start_mountable()</code></a>.</p> <div class="refsect3"> <a name="g-file-start-mountable-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-start-mountable-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the operation finished successfully. <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-stop-mountable"></a><h3>g_file_stop_mountable ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_stop_mountable (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GMount.html#GMountUnmountFlags" title="enum GMountUnmountFlags"><span class="type">GMountUnmountFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a> *mount_operation</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Stops a file of type <a class="link" href="GFileInfo.html#G-FILE-TYPE-MOUNTABLE:CAPS"><span class="type">G_FILE_TYPE_MOUNTABLE</span></a>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-stop-mountable-finish" title="g_file_stop_mountable_finish ()"><code class="function">g_file_stop_mountable_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-stop-mountable.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting the operation</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>mount_operation</p></td> <td class="parameter_description"><p>a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a>, or <code class="literal">NULL</code> to avoid user interaction. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-stop-mountable-finish"></a><h3>g_file_stop_mountable_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_stop_mountable_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes a stop operation, see <a class="link" href="GFile.html#g-file-stop-mountable" title="g_file_stop_mountable ()"><code class="function">g_file_stop_mountable()</code></a> for details.</p> <p>Finish an asynchronous stop operation that was started with <a class="link" href="GFile.html#g-file-stop-mountable" title="g_file_stop_mountable ()"><code class="function">g_file_stop_mountable()</code></a>.</p> <div class="refsect3"> <a name="g-file-stop-mountable-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-stop-mountable-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the operation finished successfully. <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-poll-mountable"></a><h3>g_file_poll_mountable ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_poll_mountable (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Polls a file of type <a class="link" href="GFileInfo.html#G-FILE-TYPE-MOUNTABLE:CAPS"><span class="type">G_FILE_TYPE_MOUNTABLE</span></a>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-mount-mountable-finish" title="g_file_mount_mountable_finish ()"><code class="function">g_file_mount_mountable_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-poll-mountable.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-poll-mountable-finish"></a><h3>g_file_poll_mountable_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_poll_mountable_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes a poll operation. See <a class="link" href="GFile.html#g-file-poll-mountable" title="g_file_poll_mountable ()"><code class="function">g_file_poll_mountable()</code></a> for details.</p> <p>Finish an asynchronous poll operation that was polled with <a class="link" href="GFile.html#g-file-poll-mountable" title="g_file_poll_mountable ()"><code class="function">g_file_poll_mountable()</code></a>.</p> <div class="refsect3"> <a name="g-file-poll-mountable-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-poll-mountable-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the operation finished successfully. <code class="literal">FALSE</code> otherwise.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-mount-enclosing-volume"></a><h3>g_file_mount_enclosing_volume ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_mount_enclosing_volume (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *location</code></em>, <em class="parameter"><code><a class="link" href="GMount.html#GMountMountFlags" title="enum GMountMountFlags"><span class="type">GMountMountFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a> *mount_operation</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Starts a <em class="parameter"><code>mount_operation</code></em> , mounting the volume that contains the file <em class="parameter"><code>location</code></em> .</p> <p>When this operation has completed, <em class="parameter"><code>callback</code></em> will be called with <em class="parameter"><code>user_user</code></em> data, and the operation can be finalized with <a class="link" href="GFile.html#g-file-mount-enclosing-volume-finish" title="g_file_mount_enclosing_volume_finish ()"><code class="function">g_file_mount_enclosing_volume_finish()</code></a>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-mount-enclosing-volume.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>location</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting the operation</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>mount_operation</p></td> <td class="parameter_description"><p>a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a> or <code class="literal">NULL</code> to avoid user interaction. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-mount-enclosing-volume-finish"></a><h3>g_file_mount_enclosing_volume_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_mount_enclosing_volume_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *location</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes a mount operation started by <a class="link" href="GFile.html#g-file-mount-enclosing-volume" title="g_file_mount_enclosing_volume ()"><code class="function">g_file_mount_enclosing_volume()</code></a>.</p> <div class="refsect3"> <a name="g-file-mount-enclosing-volume-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>location</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-mount-enclosing-volume-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if successful. If an error has occurred, this function will return <code class="literal">FALSE</code> and set <em class="parameter"><code>error</code></em> appropriately if present.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-monitor-directory"></a><h3>g_file_monitor_directory ()</h3> <pre class="programlisting"><a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="returnvalue">GFileMonitor</span></a> * g_file_monitor_directory (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileMonitorFlags" title="enum GFileMonitorFlags"><span class="type">GFileMonitorFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>It does not make sense for <em class="parameter"><code>flags</code></em> to contain <a class="link" href="GFile.html#G-FILE-MONITOR-WATCH-HARD-LINKS:CAPS"><code class="literal">G_FILE_MONITOR_WATCH_HARD_LINKS</code></a>, since hard links can not be made to directories. It is not possible to monitor all the files in a directory for changes made via hard links; if you want to do this then you must register individual watches with <a class="link" href="GFile.html#g-file-monitor" title="g_file_monitor ()"><code class="function">g_file_monitor()</code></a>.</p> <p>Virtual: monitor_dir</p> <div class="refsect3"> <a name="g-file-monitor-directory.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileMonitorFlags" title="enum GFileMonitorFlags"><span class="type">GFileMonitorFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-monitor-directory.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="type">GFileMonitor</span></a> for the given <em class="parameter"><code>file</code></em> , or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-monitor-file"></a><h3>g_file_monitor_file ()</h3> <pre class="programlisting"><a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="returnvalue">GFileMonitor</span></a> * g_file_monitor_file (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileMonitorFlags" title="enum GFileMonitorFlags"><span class="type">GFileMonitorFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Obtains a file monitor for the given file. If no file notification mechanism exists, then regular polling of the file is used.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If <em class="parameter"><code>flags</code></em> contains <a class="link" href="GFile.html#G-FILE-MONITOR-WATCH-HARD-LINKS:CAPS"><code class="literal">G_FILE_MONITOR_WATCH_HARD_LINKS</code></a> then the monitor will also attempt to report changes made to the file via another filename (ie, a hard link). Without this flag, you can only rely on changes made through the filename contained in <em class="parameter"><code>file</code></em> to be reported. Using this flag may result in an increase in resource usage, and may not have any effect depending on the <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="type">GFileMonitor</span></a> backend and/or filesystem type.</p> <div class="refsect3"> <a name="g-file-monitor-file.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileMonitorFlags" title="enum GFileMonitorFlags"><span class="type">GFileMonitorFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-monitor-file.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="type">GFileMonitor</span></a> for the given <em class="parameter"><code>file</code></em> , or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-monitor"></a><h3>g_file_monitor ()</h3> <pre class="programlisting"><a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="returnvalue">GFileMonitor</span></a> * g_file_monitor (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileMonitorFlags" title="enum GFileMonitorFlags"><span class="type">GFileMonitorFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Obtains a file or directory monitor for the given file, depending on the type of the file.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-monitor.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileMonitorFlags" title="enum GFileMonitorFlags"><span class="type">GFileMonitorFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-monitor.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="type">GFileMonitor</span></a> for the given <em class="parameter"><code>file</code></em> , or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-18.html#api-index-2.18">2.18</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-load-bytes"></a><h3>g_file_load_bytes ()</h3> <pre class="programlisting"><span class="returnvalue">GBytes</span> * g_file_load_bytes (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">gchar</span> **etag_out</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Loads the contents of <em class="parameter"><code>file</code></em> and returns it as <span class="type">GBytes</span>.</p> <p>If <em class="parameter"><code>file</code></em> is a resource:// based URI, the resulting bytes will reference the embedded resource instead of a copy. Otherwise, this is equivalent to calling <a class="link" href="GFile.html#g-file-load-contents" title="g_file_load_contents ()"><code class="function">g_file_load_contents()</code></a> and <code class="function">g_bytes_new_take()</code>.</p> <p>For resources, <em class="parameter"><code>etag_out</code></em> will be set to <code class="literal">NULL</code>.</p> <p>The data contained in the resulting <span class="type">GBytes</span> is always zero-terminated, but this is not included in the <span class="type">GBytes</span> length. The resulting <span class="type">GBytes</span> should be freed with <code class="function">g_bytes_unref()</code> when no longer in use.</p> <div class="refsect3"> <a name="g-file-load-bytes.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>etag_out</p></td> <td class="parameter_description"><p>a location to place the current entity tag for the file, or <code class="literal">NULL</code> if the entity tag is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a location for a <span class="type">GError</span> or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-load-bytes.returns"></a><h4>Returns</h4> <p>a <span class="type">GBytes</span> or <code class="literal">NULL</code> and <em class="parameter"><code>error</code></em> is set. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-56.html#api-index-2.56">2.56</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-load-bytes-async"></a><h3>g_file_load_bytes_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_load_bytes_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously loads the contents of <em class="parameter"><code>file</code></em> as <span class="type">GBytes</span>.</p> <p>If <em class="parameter"><code>file</code></em> is a resource:// based URI, the resulting bytes will reference the embedded resource instead of a copy. Otherwise, this is equivalent to calling <a class="link" href="GFile.html#g-file-load-contents-async" title="g_file_load_contents_async ()"><code class="function">g_file_load_contents_async()</code></a> and <code class="function">g_bytes_new_take()</code>.</p> <p><em class="parameter"><code>callback</code></em> should call <a class="link" href="GFile.html#g-file-load-bytes-finish" title="g_file_load_bytes_finish ()"><code class="function">g_file_load_bytes_finish()</code></a> to get the result of this asynchronous operation.</p> <p>See <a class="link" href="GFile.html#g-file-load-bytes" title="g_file_load_bytes ()"><code class="function">g_file_load_bytes()</code></a> for more information.</p> <div class="refsect3"> <a name="g-file-load-bytes-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-56.html#api-index-2.56">2.56</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-load-bytes-finish"></a><h3>g_file_load_bytes_finish ()</h3> <pre class="programlisting"><span class="returnvalue">GBytes</span> * g_file_load_bytes_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>, <em class="parameter"><code><span class="type">gchar</span> **etag_out</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Completes an asynchronous request to <a class="link" href="GFile.html#g-file-load-bytes-async" title="g_file_load_bytes_async ()"><code class="function">g_file_load_bytes_async()</code></a>.</p> <p>For resources, <em class="parameter"><code>etag_out</code></em> will be set to <code class="literal">NULL</code>.</p> <p>The data contained in the resulting <span class="type">GBytes</span> is always zero-terminated, but this is not included in the <span class="type">GBytes</span> length. The resulting <span class="type">GBytes</span> should be freed with <code class="function">g_bytes_unref()</code> when no longer in use.</p> <p>See <a class="link" href="GFile.html#g-file-load-bytes" title="g_file_load_bytes ()"><code class="function">g_file_load_bytes()</code></a> for more information.</p> <div class="refsect3"> <a name="g-file-load-bytes-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>result</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> provided to the callback</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>etag_out</p></td> <td class="parameter_description"><p>a location to place the current entity tag for the file, or <code class="literal">NULL</code> if the entity tag is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a location for a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-load-bytes-finish.returns"></a><h4>Returns</h4> <p>a <span class="type">GBytes</span> or <code class="literal">NULL</code> and <em class="parameter"><code>error</code></em> is set. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-56.html#api-index-2.56">2.56</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-load-contents"></a><h3>g_file_load_contents ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_load_contents (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">char</span> **contents</code></em>, <em class="parameter"><code><span class="type">gsize</span> *length</code></em>, <em class="parameter"><code><span class="type">char</span> **etag_out</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Loads the content of the file into memory. The data is always zero-terminated, but this is not included in the resultant <em class="parameter"><code>length</code></em> . The returned <em class="parameter"><code>contents</code></em> should be freed with <code class="function">g_free()</code> when no longer needed.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-load-contents.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>contents</p></td> <td class="parameter_description"><p>a location to place the contents of the file. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length]</span></td> </tr> <tr> <td class="parameter_name"><p>length</p></td> <td class="parameter_description"><p>a location to place the length of the contents of the file, or <code class="literal">NULL</code> if the length is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>etag_out</p></td> <td class="parameter_description"><p>a location to place the current entity tag for the file, or <code class="literal">NULL</code> if the entity tag is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-load-contents.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>file</code></em> 's contents were successfully loaded. <code class="literal">FALSE</code> if there were errors.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-load-contents-async"></a><h3>g_file_load_contents_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_load_contents_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Starts an asynchronous load of the <em class="parameter"><code>file</code></em> 's contents.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-load-contents" title="g_file_load_contents ()"><code class="function">g_file_load_contents()</code></a> which is the synchronous version of this call.</p> <p>When the load operation has completed, <em class="parameter"><code>callback</code></em> will be called with <em class="parameter"><code>user</code></em> data. To finish the operation, call <a class="link" href="GFile.html#g-file-load-contents-finish" title="g_file_load_contents_finish ()"><code class="function">g_file_load_contents_finish()</code></a> with the <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> returned by the <em class="parameter"><code>callback</code></em> .</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <div class="refsect3"> <a name="g-file-load-contents-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-load-contents-finish"></a><h3>g_file_load_contents_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_load_contents_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">char</span> **contents</code></em>, <em class="parameter"><code><span class="type">gsize</span> *length</code></em>, <em class="parameter"><code><span class="type">char</span> **etag_out</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous load of the <em class="parameter"><code>file</code></em> 's contents. The contents are placed in <em class="parameter"><code>contents</code></em> , and <em class="parameter"><code>length</code></em> is set to the size of the <em class="parameter"><code>contents</code></em> string. The <em class="parameter"><code>contents</code></em> should be freed with <code class="function">g_free()</code> when no longer needed. If <em class="parameter"><code>etag_out</code></em> is present, it will be set to the new entity tag for the <em class="parameter"><code>file</code></em> .</p> <div class="refsect3"> <a name="g-file-load-contents-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>contents</p></td> <td class="parameter_description"><p>a location to place the contents of the file. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length]</span></td> </tr> <tr> <td class="parameter_name"><p>length</p></td> <td class="parameter_description"><p>a location to place the length of the contents of the file, or <code class="literal">NULL</code> if the length is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>etag_out</p></td> <td class="parameter_description"><p>a location to place the current entity tag for the file, or <code class="literal">NULL</code> if the entity tag is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-load-contents-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the load was successful. If <code class="literal">FALSE</code> and <em class="parameter"><code>error</code></em> is present, it will be set appropriately.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-load-partial-contents-async"></a><h3>g_file_load_partial_contents_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_load_partial_contents_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileReadMoreCallback" title="GFileReadMoreCallback ()"><span class="type">GFileReadMoreCallback</span></a> read_more_callback</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Reads the partial contents of a file. A <a class="link" href="GFile.html#GFileReadMoreCallback" title="GFileReadMoreCallback ()"><span class="type">GFileReadMoreCallback</span></a> should be used to stop reading from the file when appropriate, else this function will behave exactly as <a class="link" href="GFile.html#g-file-load-contents-async" title="g_file_load_contents_async ()"><code class="function">g_file_load_contents_async()</code></a>. This operation can be finished by <a class="link" href="GFile.html#g-file-load-partial-contents-finish" title="g_file_load_partial_contents_finish ()"><code class="function">g_file_load_partial_contents_finish()</code></a>.</p> <p>Users of this function should be aware that <em class="parameter"><code>user_data</code></em> is passed to both the <em class="parameter"><code>read_more_callback</code></em> and the <em class="parameter"><code>callback</code></em> .</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> <div class="refsect3"> <a name="g-file-load-partial-contents-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>read_more_callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html#GFileReadMoreCallback" title="GFileReadMoreCallback ()"><span class="type">GFileReadMoreCallback</span></a> to receive partial data and to specify whether further data should be read. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>][<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym> user_data]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>][<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym> user_data]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to the callback functions</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-load-partial-contents-finish"></a><h3>g_file_load_partial_contents_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_load_partial_contents_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">char</span> **contents</code></em>, <em class="parameter"><code><span class="type">gsize</span> *length</code></em>, <em class="parameter"><code><span class="type">char</span> **etag_out</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous partial load operation that was started with <a class="link" href="GFile.html#g-file-load-partial-contents-async" title="g_file_load_partial_contents_async ()"><code class="function">g_file_load_partial_contents_async()</code></a>. The data is always zero-terminated, but this is not included in the resultant <em class="parameter"><code>length</code></em> . The returned <em class="parameter"><code>contents</code></em> should be freed with <code class="function">g_free()</code> when no longer needed.</p> <div class="refsect3"> <a name="g-file-load-partial-contents-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>contents</p></td> <td class="parameter_description"><p>a location to place the contents of the file. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length]</span></td> </tr> <tr> <td class="parameter_name"><p>length</p></td> <td class="parameter_description"><p>a location to place the length of the contents of the file, or <code class="literal">NULL</code> if the length is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>etag_out</p></td> <td class="parameter_description"><p>a location to place the current entity tag for the file, or <code class="literal">NULL</code> if the entity tag is not needed. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-load-partial-contents-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the load was successful. If <code class="literal">FALSE</code> and <em class="parameter"><code>error</code></em> is present, it will be set appropriately.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-replace-contents"></a><h3>g_file_replace_contents ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_replace_contents (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *contents</code></em>, <em class="parameter"><code><span class="type">gsize</span> length</code></em>, <em class="parameter"><code>const <span class="type">char</span> *etag</code></em>, <em class="parameter"><code><span class="type">gboolean</span> make_backup</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">char</span> **new_etag</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Replaces the contents of <em class="parameter"><code>file</code></em> with <em class="parameter"><code>contents</code></em> of <em class="parameter"><code>length</code></em> bytes.</p> <p>If <em class="parameter"><code>etag</code></em> is specified (not <code class="literal">NULL</code>), any existing file must have that etag, or the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-WRONG-ETAG:CAPS"><code class="literal">G_IO_ERROR_WRONG_ETAG</code></a> will be returned.</p> <p>If <em class="parameter"><code>make_backup</code></em> is <code class="literal">TRUE</code>, this function will attempt to make a backup of <em class="parameter"><code>file</code></em> . Internally, it uses <a class="link" href="GFile.html#g-file-replace" title="g_file_replace ()"><code class="function">g_file_replace()</code></a>, so will try to replace the file contents in the safest way possible. For example, atomic renames are used when replacing local files’ contents.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>The returned <em class="parameter"><code>new_etag</code></em> can be used to verify that the file hasn't changed the next time it is saved over.</p> <div class="refsect3"> <a name="g-file-replace-contents.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>contents</p></td> <td class="parameter_description"><p>a string containing the new contents for <em class="parameter"><code>file</code></em> . </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length]</span></td> </tr> <tr> <td class="parameter_name"><p>length</p></td> <td class="parameter_description"><p>the length of <em class="parameter"><code>contents</code></em> in bytes</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>etag</p></td> <td class="parameter_description"><p>the old <a class="link" href="GFile.html#gfile-etag" title="Entity Tags">entity-tag</a> for the document, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>make_backup</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if a backup should be created</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>new_etag</p></td> <td class="parameter_description"><p>a location to a new <a class="link" href="GFile.html#gfile-etag" title="Entity Tags">entity tag</a> for the document. This should be freed with <code class="function">g_free()</code> when no longer needed, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-replace-contents.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if successful. If an error has occurred, this function will return <code class="literal">FALSE</code> and set <em class="parameter"><code>error</code></em> appropriately if present.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-replace-contents-async"></a><h3>g_file_replace_contents_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_replace_contents_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *contents</code></em>, <em class="parameter"><code><span class="type">gsize</span> length</code></em>, <em class="parameter"><code>const <span class="type">char</span> *etag</code></em>, <em class="parameter"><code><span class="type">gboolean</span> make_backup</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Starts an asynchronous replacement of <em class="parameter"><code>file</code></em> with the given <em class="parameter"><code>contents</code></em> of <em class="parameter"><code>length</code></em> bytes. <em class="parameter"><code>etag</code></em> will replace the document's current entity tag.</p> <p>When this operation has completed, <em class="parameter"><code>callback</code></em> will be called with <em class="parameter"><code>user_user</code></em> data, and the operation can be finalized with <a class="link" href="GFile.html#g-file-replace-contents-finish" title="g_file_replace_contents_finish ()"><code class="function">g_file_replace_contents_finish()</code></a>.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If <em class="parameter"><code>make_backup</code></em> is <code class="literal">TRUE</code>, this function will attempt to make a backup of <em class="parameter"><code>file</code></em> .</p> <p>Note that no copy of <em class="parameter"><code>contents</code></em> will be made, so it must stay valid until <em class="parameter"><code>callback</code></em> is called. See <a class="link" href="GFile.html#g-file-replace-contents-bytes-async" title="g_file_replace_contents_bytes_async ()"><code class="function">g_file_replace_contents_bytes_async()</code></a> for a <span class="type">GBytes</span> version that will automatically hold a reference to the contents (without copying) for the duration of the call.</p> <div class="refsect3"> <a name="g-file-replace-contents-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>contents</p></td> <td class="parameter_description"><p>string of contents to replace the file with. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length]</span></td> </tr> <tr> <td class="parameter_name"><p>length</p></td> <td class="parameter_description"><p>the length of <em class="parameter"><code>contents</code></em> in bytes</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>etag</p></td> <td class="parameter_description"><p>a new <a class="link" href="GFile.html#gfile-etag" title="Entity Tags">entity tag</a> for the <em class="parameter"><code>file</code></em> , or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>make_backup</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if a backup should be created</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="g-file-replace-contents-bytes-async"></a><h3>g_file_replace_contents_bytes_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_replace_contents_bytes_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><span class="type">GBytes</span> *contents</code></em>, <em class="parameter"><code>const <span class="type">char</span> *etag</code></em>, <em class="parameter"><code><span class="type">gboolean</span> make_backup</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Same as <a class="link" href="GFile.html#g-file-replace-contents-async" title="g_file_replace_contents_async ()"><code class="function">g_file_replace_contents_async()</code></a> but takes a <span class="type">GBytes</span> input instead. This function will keep a ref on <em class="parameter"><code>contents</code></em> until the operation is done. Unlike <a class="link" href="GFile.html#g-file-replace-contents-async" title="g_file_replace_contents_async ()"><code class="function">g_file_replace_contents_async()</code></a> this allows forgetting about the content without waiting for the callback.</p> <p>When this operation has completed, <em class="parameter"><code>callback</code></em> will be called with <em class="parameter"><code>user_user</code></em> data, and the operation can be finalized with <a class="link" href="GFile.html#g-file-replace-contents-finish" title="g_file_replace_contents_finish ()"><code class="function">g_file_replace_contents_finish()</code></a>.</p> <div class="refsect3"> <a name="g-file-replace-contents-bytes-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>contents</p></td> <td class="parameter_description"><p>a <span class="type">GBytes</span></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>etag</p></td> <td class="parameter_description"><p>a new <a class="link" href="GFile.html#gfile-etag" title="Entity Tags">entity tag</a> for the <em class="parameter"><code>file</code></em> , or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>make_backup</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if a backup should be created</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-replace-contents-finish"></a><h3>g_file_replace_contents_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_replace_contents_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">char</span> **new_etag</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous replace of the given <em class="parameter"><code>file</code></em> . See <a class="link" href="GFile.html#g-file-replace-contents-async" title="g_file_replace_contents_async ()"><code class="function">g_file_replace_contents_async()</code></a>. Sets <em class="parameter"><code>new_etag</code></em> to the new entity tag for the document, if present.</p> <div class="refsect3"> <a name="g-file-replace-contents-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>new_etag</p></td> <td class="parameter_description"><p>a location of a new <a class="link" href="GFile.html#gfile-etag" title="Entity Tags">entity tag</a> for the document. This should be freed with <code class="function">g_free()</code> when it is no longer needed, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-replace-contents-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> on failure.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-copy-attributes"></a><h3>g_file_copy_attributes ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_copy_attributes (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *source</code></em>, <em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *destination</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCopyFlags" title="enum GFileCopyFlags"><span class="type">GFileCopyFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Copies the file attributes from <em class="parameter"><code>source</code></em> to <em class="parameter"><code>destination</code></em> .</p> <p>Normally only a subset of the file attributes are copied, those that are copies in a normal file copy operation (which for instance does not include e.g. owner). However if <a class="link" href="GFile.html#G-FILE-COPY-ALL-METADATA:CAPS"><span class="type">G_FILE_COPY_ALL_METADATA</span></a> is specified in <em class="parameter"><code>flags</code></em> , then all the metadata that is possible to copy is copied. This is useful when implementing move by copy + delete source.</p> <div class="refsect3"> <a name="g-file-copy-attributes.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>source</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> with attributes</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>destination</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to copy attributes to</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCopyFlags" title="enum GFileCopyFlags"><span class="type">GFileCopyFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, <code class="literal">NULL</code> to ignore</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-copy-attributes.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the attributes were copied successfully, <code class="literal">FALSE</code> otherwise.</p> </div> </div> <hr> <div class="refsect2"> <a name="g-file-create-readwrite"></a><h3>g_file_create_readwrite ()</h3> <pre class="programlisting"><a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * g_file_create_readwrite (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Creates a new file and returns a stream for reading and writing to it. The file must not already exist.</p> <p>By default files created are generally readable by everyone, but if you pass <a class="link" href="GFile.html#G-FILE-CREATE-PRIVATE:CAPS"><span class="type">G_FILE_CREATE_PRIVATE</span></a> in <em class="parameter"><code>flags</code></em> the file will be made readable only to the current user, to the level that is supported on the target filesystem.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If a file or directory with this name already exists, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-EXISTS:CAPS"><code class="literal">G_IO_ERROR_EXISTS</code></a> error will be returned. Some file systems don't allow all file names, and may return an <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-FILENAME:CAPS"><code class="literal">G_IO_ERROR_INVALID_FILENAME</code></a> error, and if the name is too long, <a class="link" href="gio-GIOError.html#G-IO-ERROR-FILENAME-TOO-LONG:CAPS"><code class="literal">G_IO_ERROR_FILENAME_TOO_LONG</code></a> will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.</p> <p>Note that in many non-local file cases read and write streams are not supported, so make sure you really need to do read and write streaming, rather than just opening for reading or writing.</p> <div class="refsect3"> <a name="g-file-create-readwrite.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-create-readwrite.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> for the newly created file, or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-create-readwrite-async"></a><h3>g_file_create_readwrite_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_create_readwrite_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously creates a new file and returns a stream for reading and writing to it. The file must not already exist.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-create-readwrite" title="g_file_create_readwrite ()"><code class="function">g_file_create_readwrite()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-create-readwrite-finish" title="g_file_create_readwrite_finish ()"><code class="function">g_file_create_readwrite_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-create-readwrite-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-create-readwrite-finish"></a><h3>g_file_create_readwrite_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * g_file_create_readwrite_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous file create operation started with <a class="link" href="GFile.html#g-file-create-readwrite-async" title="g_file_create_readwrite_async ()"><code class="function">g_file_create_readwrite_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-create-readwrite-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-create-readwrite-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-open-readwrite"></a><h3>g_file_open_readwrite ()</h3> <pre class="programlisting"><a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * g_file_open_readwrite (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Opens an existing file for reading and writing. The result is a <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> that can be used to read and write the contents of the file.</p> <p>If <em class="parameter"><code>cancellable</code></em> is not <code class="literal">NULL</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> will be returned.</p> <p>If the file does not exist, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-FOUND:CAPS"><code class="literal">G_IO_ERROR_NOT_FOUND</code></a> error will be returned. If the file is a directory, the <a class="link" href="gio-GIOError.html#G-IO-ERROR-IS-DIRECTORY:CAPS"><code class="literal">G_IO_ERROR_IS_DIRECTORY</code></a> error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on. Note that in many non-local file cases read and write streams are not supported, so make sure you really need to do read and write streaming, rather than just opening for reading or writing.</p> <div class="refsect3"> <a name="g-file-open-readwrite.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to open</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-open-readwrite.returns"></a><h4>Returns</h4> <p><a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-open-readwrite-async"></a><h3>g_file_open_readwrite_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_open_readwrite_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously opens <em class="parameter"><code>file</code></em> for reading and writing.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-open-readwrite" title="g_file_open_readwrite ()"><code class="function">g_file_open_readwrite()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-open-readwrite-finish" title="g_file_open_readwrite_finish ()"><code class="function">g_file_open_readwrite_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-open-readwrite-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-open-readwrite-finish"></a><h3>g_file_open_readwrite_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * g_file_open_readwrite_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous file read operation started with <a class="link" href="GFile.html#g-file-open-readwrite-async" title="g_file_open_readwrite_async ()"><code class="function">g_file_open_readwrite_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-open-readwrite-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-open-readwrite-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-replace-readwrite"></a><h3>g_file_replace_readwrite ()</h3> <pre class="programlisting"><a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * g_file_replace_readwrite (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *etag</code></em>, <em class="parameter"><code><span class="type">gboolean</span> make_backup</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Returns an output stream for overwriting the file in readwrite mode, possibly creating a backup copy of the file first. If the file doesn't exist, it will be created.</p> <p>For details about the behaviour, see <a class="link" href="GFile.html#g-file-replace" title="g_file_replace ()"><code class="function">g_file_replace()</code></a> which does the same thing but returns an output stream only.</p> <p>Note that in many non-local file cases read and write streams are not supported, so make sure you really need to do read and write streaming, rather than just opening for reading or writing.</p> <div class="refsect3"> <a name="g-file-replace-readwrite.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>etag</p></td> <td class="parameter_description"><p>an optional <a class="link" href="GFile.html#gfile-etag" title="Entity Tags">entity tag</a> for the current <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>, or <span class="type">NULL</span> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>make_backup</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if a backup should be created</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-replace-readwrite.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a> or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-replace-readwrite-async"></a><h3>g_file_replace_readwrite_async ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_file_replace_readwrite_async (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code>const <span class="type">char</span> *etag</code></em>, <em class="parameter"><code><span class="type">gboolean</span> make_backup</code></em>, <em class="parameter"><code><a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">int</span> io_priority</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.</p> <p>For more details, see <a class="link" href="GFile.html#g-file-replace-readwrite" title="g_file_replace_readwrite ()"><code class="function">g_file_replace_readwrite()</code></a> which is the synchronous version of this call.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call <a class="link" href="GFile.html#g-file-replace-readwrite-finish" title="g_file_replace_readwrite_finish ()"><code class="function">g_file_replace_readwrite_finish()</code></a> to get the result of the operation.</p> <div class="refsect3"> <a name="g-file-replace-readwrite-async.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>etag</p></td> <td class="parameter_description"><p>an <a class="link" href="GFile.html#gfile-etag" title="Entity Tags">entity tag</a> for the current <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>, or <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>make_backup</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if a backup should be created</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>a set of <a class="link" href="GFile.html#GFileCreateFlags" title="enum GFileCreateFlags"><span class="type">GFileCreateFlags</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>io_priority</p></td> <td class="parameter_description"><p>the <a class="link" href="GAsyncResult.html#io-priority" title="I/O Priority">I/O priority</a> of the request</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <code class="literal">NULL</code> to ignore. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to callback function. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-replace-readwrite-finish"></a><h3>g_file_replace_readwrite_finish ()</h3> <pre class="programlisting"><a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="returnvalue">GFileIOStream</span></a> * g_file_replace_readwrite_finish (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an asynchronous file replace operation started with <a class="link" href="GFile.html#g-file-replace-readwrite-async" title="g_file_replace_readwrite_async ()"><code class="function">g_file_replace_readwrite_async()</code></a>.</p> <div class="refsect3"> <a name="g-file-replace-readwrite-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>input <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span>, or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-replace-readwrite-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GFileIOStream.html" title="GFileIOStream"><span class="type">GFileIOStream</span></a>, or <code class="literal">NULL</code> on error. Free the returned object with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> <hr> <div class="refsect2"> <a name="g-file-supports-thread-contexts"></a><h3>g_file_supports_thread_contexts ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_file_supports_thread_contexts (<em class="parameter"><code><a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> *file</code></em>);</pre> <p>Checks if <em class="parameter"><code>file</code></em> supports thread-default contexts. If this returns <code class="literal">FALSE</code>, you cannot perform asynchronous operations on <em class="parameter"><code>file</code></em> in a thread that has a thread-default context.</p> <div class="refsect3"> <a name="g-file-supports-thread-contexts.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>file</p></td> <td class="parameter_description"><p>a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-file-supports-thread-contexts.returns"></a><h4>Returns</h4> <p> Whether or not <em class="parameter"><code>file</code></em> supports thread-default contexts.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> </div> </div> <div class="refsect1"> <a name="GFile.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="GFile-struct"></a><h3>GFile</h3> <pre class="programlisting">typedef struct _GFile GFile;</pre> <p>A handle to an object implementing the <a class="link" href="GFile.html#GFileIface" title="struct GFileIface"><span class="type">GFileIface</span></a> interface. Generally stores a location within the file system. Handles do not necessarily represent files or directories that currently exist.</p> </div> <hr> <div class="refsect2"> <a name="GFileIface"></a><h3>struct GFileIface</h3> <pre class="programlisting">struct GFileIface { GTypeInterface g_iface; /* Virtual Table */ GFile * (* dup) (GFile *file); guint (* hash) (GFile *file); gboolean (* equal) (GFile *file1, GFile *file2); gboolean (* is_native) (GFile *file); gboolean (* has_uri_scheme) (GFile *file, const char *uri_scheme); char * (* get_uri_scheme) (GFile *file); char * (* get_basename) (GFile *file); char * (* get_path) (GFile *file); char * (* get_uri) (GFile *file); char * (* get_parse_name) (GFile *file); GFile * (* get_parent) (GFile *file); gboolean (* prefix_matches) (GFile *prefix, GFile *file); char * (* get_relative_path) (GFile *parent, GFile *descendant); GFile * (* resolve_relative_path) (GFile *file, const char *relative_path); GFile * (* get_child_for_display_name) (GFile *file, const char *display_name, GError **error); GFileEnumerator * (* enumerate_children) (GFile *file, const char *attributes, GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error); void (* enumerate_children_async) (GFile *file, const char *attributes, GFileQueryInfoFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileEnumerator * (* enumerate_children_finish) (GFile *file, GAsyncResult *res, GError **error); GFileInfo * (* query_info) (GFile *file, const char *attributes, GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error); void (* query_info_async) (GFile *file, const char *attributes, GFileQueryInfoFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileInfo * (* query_info_finish) (GFile *file, GAsyncResult *res, GError **error); GFileInfo * (* query_filesystem_info) (GFile *file, const char *attributes, GCancellable *cancellable, GError **error); void (* query_filesystem_info_async) (GFile *file, const char *attributes, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileInfo * (* query_filesystem_info_finish)(GFile *file, GAsyncResult *res, GError **error); GMount * (* find_enclosing_mount) (GFile *file, GCancellable *cancellable, GError **error); void (* find_enclosing_mount_async) (GFile *file, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GMount * (* find_enclosing_mount_finish) (GFile *file, GAsyncResult *res, GError **error); GFile * (* set_display_name) (GFile *file, const char *display_name, GCancellable *cancellable, GError **error); void (* set_display_name_async) (GFile *file, const char *display_name, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFile * (* set_display_name_finish) (GFile *file, GAsyncResult *res, GError **error); GFileAttributeInfoList * (* query_settable_attributes) (GFile *file, GCancellable *cancellable, GError **error); void (* _query_settable_attributes_async) (void); void (* _query_settable_attributes_finish) (void); GFileAttributeInfoList * (* query_writable_namespaces) (GFile *file, GCancellable *cancellable, GError **error); void (* _query_writable_namespaces_async) (void); void (* _query_writable_namespaces_finish) (void); gboolean (* set_attribute) (GFile *file, const char *attribute, GFileAttributeType type, gpointer value_p, GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error); gboolean (* set_attributes_from_info) (GFile *file, GFileInfo *info, GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error); void (* set_attributes_async) (GFile *file, GFileInfo *info, GFileQueryInfoFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* set_attributes_finish) (GFile *file, GAsyncResult *result, GFileInfo **info, GError **error); GFileInputStream * (* read_fn) (GFile *file, GCancellable *cancellable, GError **error); void (* read_async) (GFile *file, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileInputStream * (* read_finish) (GFile *file, GAsyncResult *res, GError **error); GFileOutputStream * (* append_to) (GFile *file, GFileCreateFlags flags, GCancellable *cancellable, GError **error); void (* append_to_async) (GFile *file, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileOutputStream * (* append_to_finish) (GFile *file, GAsyncResult *res, GError **error); GFileOutputStream * (* create) (GFile *file, GFileCreateFlags flags, GCancellable *cancellable, GError **error); void (* create_async) (GFile *file, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileOutputStream * (* create_finish) (GFile *file, GAsyncResult *res, GError **error); GFileOutputStream * (* replace) (GFile *file, const char *etag, gboolean make_backup, GFileCreateFlags flags, GCancellable *cancellable, GError **error); void (* replace_async) (GFile *file, const char *etag, gboolean make_backup, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileOutputStream * (* replace_finish) (GFile *file, GAsyncResult *res, GError **error); gboolean (* delete_file) (GFile *file, GCancellable *cancellable, GError **error); void (* delete_file_async) (GFile *file, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* delete_file_finish) (GFile *file, GAsyncResult *result, GError **error); gboolean (* trash) (GFile *file, GCancellable *cancellable, GError **error); void (* trash_async) (GFile *file, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* trash_finish) (GFile *file, GAsyncResult *result, GError **error); gboolean (* make_directory) (GFile *file, GCancellable *cancellable, GError **error); void (* make_directory_async) (GFile *file, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* make_directory_finish) (GFile *file, GAsyncResult *result, GError **error); gboolean (* make_symbolic_link) (GFile *file, const char *symlink_value, GCancellable *cancellable, GError **error); void (* _make_symbolic_link_async) (void); void (* _make_symbolic_link_finish) (void); gboolean (* copy) (GFile *source, GFile *destination, GFileCopyFlags flags, GCancellable *cancellable, GFileProgressCallback progress_callback, gpointer progress_callback_data, GError **error); void (* copy_async) (GFile *source, GFile *destination, GFileCopyFlags flags, int io_priority, GCancellable *cancellable, GFileProgressCallback progress_callback, gpointer progress_callback_data, GAsyncReadyCallback callback, gpointer user_data); gboolean (* copy_finish) (GFile *file, GAsyncResult *res, GError **error); gboolean (* move) (GFile *source, GFile *destination, GFileCopyFlags flags, GCancellable *cancellable, GFileProgressCallback progress_callback, gpointer progress_callback_data, GError **error); void (* _move_async) (void); void (* _move_finish) (void); void (* mount_mountable) (GFile *file, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFile * (* mount_mountable_finish) (GFile *file, GAsyncResult *result, GError **error); void (* unmount_mountable) (GFile *file, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* unmount_mountable_finish) (GFile *file, GAsyncResult *result, GError **error); void (* eject_mountable) (GFile *file, GMountUnmountFlags flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* eject_mountable_finish) (GFile *file, GAsyncResult *result, GError **error); void (* mount_enclosing_volume) (GFile *location, GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* mount_enclosing_volume_finish) (GFile *location, GAsyncResult *result, GError **error); GFileMonitor * (* monitor_dir) (GFile *file, GFileMonitorFlags flags, GCancellable *cancellable, GError **error); GFileMonitor * (* monitor_file) (GFile *file, GFileMonitorFlags flags, GCancellable *cancellable, GError **error); GFileIOStream * (* open_readwrite) (GFile *file, GCancellable *cancellable, GError **error); void (* open_readwrite_async) (GFile *file, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileIOStream * (* open_readwrite_finish) (GFile *file, GAsyncResult *res, GError **error); GFileIOStream * (* create_readwrite) (GFile *file, GFileCreateFlags flags, GCancellable *cancellable, GError **error); void (* create_readwrite_async) (GFile *file, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileIOStream * (* create_readwrite_finish) (GFile *file, GAsyncResult *res, GError **error); GFileIOStream * (* replace_readwrite) (GFile *file, const char *etag, gboolean make_backup, GFileCreateFlags flags, GCancellable *cancellable, GError **error); void (* replace_readwrite_async) (GFile *file, const char *etag, gboolean make_backup, GFileCreateFlags flags, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GFileIOStream * (* replace_readwrite_finish) (GFile *file, GAsyncResult *res, GError **error); void (* start_mountable) (GFile *file, GDriveStartFlags flags, GMountOperation *start_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* start_mountable_finish) (GFile *file, GAsyncResult *result, GError **error); void (* stop_mountable) (GFile *file, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* stop_mountable_finish) (GFile *file, GAsyncResult *result, GError **error); gboolean supports_thread_contexts; void (* unmount_mountable_with_operation) (GFile *file, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* unmount_mountable_with_operation_finish) (GFile *file, GAsyncResult *result, GError **error); void (* eject_mountable_with_operation) (GFile *file, GMountUnmountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* eject_mountable_with_operation_finish) (GFile *file, GAsyncResult *result, GError **error); void (* poll_mountable) (GFile *file, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (* poll_mountable_finish) (GFile *file, GAsyncResult *result, GError **error); gboolean (* measure_disk_usage) (GFile *file, GFileMeasureFlags flags, GCancellable *cancellable, GFileMeasureProgressCallback progress_callback, gpointer progress_data, guint64 *disk_usage, guint64 *num_dirs, guint64 *num_files, GError **error); void (* measure_disk_usage_async) (GFile *file, GFileMeasureFlags flags, gint io_priority, GCancellable *cancellable, GFileMeasureProgressCallback progress_callback, gpointer progress_data, GAsyncReadyCallback callback, gpointer user_data); gboolean (* measure_disk_usage_finish) (GFile *file, GAsyncResult *result, guint64 *disk_usage, guint64 *num_dirs, guint64 *num_files, GError **error); }; </pre> <p>An interface for writing VFS file handles.</p> <div class="refsect3"> <a name="GFileIface.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="struct_members_name"> <col class="struct_members_description"> <col width="200px" class="struct_members_annotations"> </colgroup> <tbody> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.dup"></a>dup</code></em> ()</p></td> <td class="struct_member_description"><p>Duplicates a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.hash"></a>hash</code></em> ()</p></td> <td class="struct_member_description"><p>Creates a hash of a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.equal"></a>equal</code></em> ()</p></td> <td class="struct_member_description"><p>Checks equality of two given <span class="type">GFiles</span>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.is-native"></a>is_native</code></em> ()</p></td> <td class="struct_member_description"><p>Checks to see if a file is native to the system.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.has-uri-scheme"></a>has_uri_scheme</code></em> ()</p></td> <td class="struct_member_description"><p>Checks to see if a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> has a given URI scheme.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.get-uri-scheme"></a>get_uri_scheme</code></em> ()</p></td> <td class="struct_member_description"><p>Gets the URI scheme for a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.get-basename"></a>get_basename</code></em> ()</p></td> <td class="struct_member_description"><p>Gets the basename for a given <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.get-path"></a>get_path</code></em> ()</p></td> <td class="struct_member_description"><p>Gets the current path within a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.get-uri"></a>get_uri</code></em> ()</p></td> <td class="struct_member_description"><p>Gets a URI for the path within a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.get-parse-name"></a>get_parse_name</code></em> ()</p></td> <td class="struct_member_description"><p>Gets the parsed name for the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.get-parent"></a>get_parent</code></em> ()</p></td> <td class="struct_member_description"><p>Gets the parent directory for the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.prefix-matches"></a>prefix_matches</code></em> ()</p></td> <td class="struct_member_description"><p>Checks whether a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> contains a specified file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.get-relative-path"></a>get_relative_path</code></em> ()</p></td> <td class="struct_member_description"><p>Gets the path for a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> relative to a given path.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.resolve-relative-path"></a>resolve_relative_path</code></em> ()</p></td> <td class="struct_member_description"><p>Resolves a relative path for a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to an absolute path.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.get-child-for-display-name"></a>get_child_for_display_name</code></em> ()</p></td> <td class="struct_member_description"><p>Gets the child <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> for a given display name.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.enumerate-children"></a>enumerate_children</code></em> ()</p></td> <td class="struct_member_description"><p>Gets a <a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="type">GFileEnumerator</span></a> with the children of a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.enumerate-children-async"></a>enumerate_children_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously gets a <a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="type">GFileEnumerator</span></a> with the children of a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.enumerate-children-finish"></a>enumerate_children_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes asynchronously enumerating the children.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.query-info"></a>query_info</code></em> ()</p></td> <td class="struct_member_description"><p>Gets the <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> for a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.query-info-async"></a>query_info_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously gets the <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> for a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.query-info-finish"></a>query_info_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous query info operation.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.query-filesystem-info"></a>query_filesystem_info</code></em> ()</p></td> <td class="struct_member_description"><p>Gets a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> for the file system <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> is on.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.query-filesystem-info-async"></a>query_filesystem_info_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously gets a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a> for the file system <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> is on.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.query-filesystem-info-finish"></a>query_filesystem_info_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes asynchronously getting the file system info.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.find-enclosing-mount"></a>find_enclosing_mount</code></em> ()</p></td> <td class="struct_member_description"><p>Gets a <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> for the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.find-enclosing-mount-async"></a>find_enclosing_mount_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously gets the <a class="link" href="GMount.html" title="GMount"><span class="type">GMount</span></a> for a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.find-enclosing-mount-finish"></a>find_enclosing_mount_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes asynchronously getting the volume.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.set-display-name"></a>set_display_name</code></em> ()</p></td> <td class="struct_member_description"><p>Sets the display name for a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.set-display-name-async"></a>set_display_name_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously sets a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>'s display name.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.set-display-name-finish"></a>set_display_name_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes asynchronously setting a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a>'s display name.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.query-settable-attributes"></a>query_settable_attributes</code></em> ()</p></td> <td class="struct_member_description"><p>Returns a list of <a href="gio-GFileAttribute.html#GFileAttributeInfo"><span class="type">GFileAttributeInfos</span></a> that can be set.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.-query-settable-attributes-async"></a>_query_settable_attributes_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously gets a list of <a href="gio-GFileAttribute.html#GFileAttributeInfo"><span class="type">GFileAttributeInfos</span></a> that can be set.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.-query-settable-attributes-finish"></a>_query_settable_attributes_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes asynchronously querying settable attributes.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.query-writable-namespaces"></a>query_writable_namespaces</code></em> ()</p></td> <td class="struct_member_description"><p>Returns a list of <a class="link" href="gio-GFileAttribute.html#GFileAttributeInfo" title="GFileAttributeInfo"><span class="type">GFileAttributeInfo</span></a> namespaces that are writable.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.-query-writable-namespaces-async"></a>_query_writable_namespaces_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously gets a list of <a class="link" href="gio-GFileAttribute.html#GFileAttributeInfo" title="GFileAttributeInfo"><span class="type">GFileAttributeInfo</span></a> namespaces that are writable.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.-query-writable-namespaces-finish"></a>_query_writable_namespaces_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes asynchronously querying the writable namespaces.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.set-attribute"></a>set_attribute</code></em> ()</p></td> <td class="struct_member_description"><p>Sets a <a class="link" href="gio-GFileAttribute.html#GFileAttributeInfo" title="GFileAttributeInfo"><span class="type">GFileAttributeInfo</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.set-attributes-from-info"></a>set_attributes_from_info</code></em> ()</p></td> <td class="struct_member_description"><p>Sets a <a class="link" href="gio-GFileAttribute.html#GFileAttributeInfo" title="GFileAttributeInfo"><span class="type">GFileAttributeInfo</span></a> with information from a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a>.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.set-attributes-async"></a>set_attributes_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously sets a file's attributes.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.set-attributes-finish"></a>set_attributes_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes setting a file's attributes asynchronously.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.read-fn"></a>read_fn</code></em> ()</p></td> <td class="struct_member_description"><p>Reads a file asynchronously.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.read-async"></a>read_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously reads a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.read-finish"></a>read_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes asynchronously reading a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.append-to"></a>append_to</code></em> ()</p></td> <td class="struct_member_description"><p>Writes to the end of a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.append-to-async"></a>append_to_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously writes to the end of a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.append-to-finish"></a>append_to_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous file append operation.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.create"></a>create</code></em> ()</p></td> <td class="struct_member_description"><p>Creates a new file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.create-async"></a>create_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously creates a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.create-finish"></a>create_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes asynchronously creating a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.replace"></a>replace</code></em> ()</p></td> <td class="struct_member_description"><p>Replaces the contents of a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.replace-async"></a>replace_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously replaces the contents of a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.replace-finish"></a>replace_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes asynchronously replacing a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.delete-file"></a>delete_file</code></em> ()</p></td> <td class="struct_member_description"><p>Deletes a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.delete-file-async"></a>delete_file_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously deletes a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.delete-file-finish"></a>delete_file_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous delete.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.trash"></a>trash</code></em> ()</p></td> <td class="struct_member_description"><p>Sends a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to the Trash location.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.trash-async"></a>trash_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously sends a <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> to the Trash location.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.trash-finish"></a>trash_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous file trashing operation.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.make-directory"></a>make_directory</code></em> ()</p></td> <td class="struct_member_description"><p>Makes a directory.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.make-directory-async"></a>make_directory_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously makes a directory.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.make-directory-finish"></a>make_directory_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes making a directory asynchronously.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.make-symbolic-link"></a>make_symbolic_link</code></em> ()</p></td> <td class="struct_member_description"><p>Makes a symbolic link. <code class="literal">NULL</code> if symbolic links are unsupported. </p></td> <td class="struct_member_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.-make-symbolic-link-async"></a>_make_symbolic_link_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously makes a symbolic link</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.-make-symbolic-link-finish"></a>_make_symbolic_link_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes making a symbolic link asynchronously.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.copy"></a>copy</code></em> ()</p></td> <td class="struct_member_description"><p>Copies a file. <code class="literal">NULL</code> if copying is unsupported, which will cause <code class="literal">GFile</code> to use a fallback copy method where it reads from the source and writes to the destination. </p></td> <td class="struct_member_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.copy-async"></a>copy_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously copies a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.copy-finish"></a>copy_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous copy operation.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.move"></a>move</code></em> ()</p></td> <td class="struct_member_description"><p>Moves a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.-move-async"></a>_move_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously moves a file.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.-move-finish"></a>_move_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous move operation.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.mount-mountable"></a>mount_mountable</code></em> ()</p></td> <td class="struct_member_description"><p>Mounts a mountable object.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.mount-mountable-finish"></a>mount_mountable_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes a mounting operation.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.unmount-mountable"></a>unmount_mountable</code></em> ()</p></td> <td class="struct_member_description"><p>Unmounts a mountable object.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.unmount-mountable-finish"></a>unmount_mountable_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an unmount operation.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.eject-mountable"></a>eject_mountable</code></em> ()</p></td> <td class="struct_member_description"><p>Ejects a mountable.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.eject-mountable-finish"></a>eject_mountable_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an eject operation.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.mount-enclosing-volume"></a>mount_enclosing_volume</code></em> ()</p></td> <td class="struct_member_description"><p>Mounts a specified location.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.mount-enclosing-volume-finish"></a>mount_enclosing_volume_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes mounting a specified location.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.monitor-dir"></a>monitor_dir</code></em> ()</p></td> <td class="struct_member_description"><p>Creates a <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="type">GFileMonitor</span></a> for the location.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.monitor-file"></a>monitor_file</code></em> ()</p></td> <td class="struct_member_description"><p>Creates a <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="type">GFileMonitor</span></a> for the location.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.open-readwrite"></a>open_readwrite</code></em> ()</p></td> <td class="struct_member_description"><p>Open file read/write. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.open-readwrite-async"></a>open_readwrite_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously opens file read/write. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.open-readwrite-finish"></a>open_readwrite_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous open read/write. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.create-readwrite"></a>create_readwrite</code></em> ()</p></td> <td class="struct_member_description"><p>Creates file read/write. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.create-readwrite-async"></a>create_readwrite_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously creates file read/write. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.create-readwrite-finish"></a>create_readwrite_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous creates read/write. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.replace-readwrite"></a>replace_readwrite</code></em> ()</p></td> <td class="struct_member_description"><p>Replaces file read/write. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.replace-readwrite-async"></a>replace_readwrite_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously replaces file read/write. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.replace-readwrite-finish"></a>replace_readwrite_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous replace read/write. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.start-mountable"></a>start_mountable</code></em> ()</p></td> <td class="struct_member_description"><p>Starts a mountable object. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.start-mountable-finish"></a>start_mountable_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes a start operation. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.stop-mountable"></a>stop_mountable</code></em> ()</p></td> <td class="struct_member_description"><p>Stops a mountable. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.stop-mountable-finish"></a>stop_mountable_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes a stop operation. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><span class="type">gboolean</span> <em class="structfield"><code><a name="GFileIface.supports-thread-contexts"></a>supports_thread_contexts</code></em>;</p></td> <td class="struct_member_description"><p>a boolean that indicates whether the <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> implementation supports thread-default contexts. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.unmount-mountable-with-operation"></a>unmount_mountable_with_operation</code></em> ()</p></td> <td class="struct_member_description"><p>Unmounts a mountable object using a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a>. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.unmount-mountable-with-operation-finish"></a>unmount_mountable_with_operation_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an unmount operation using a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a>. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.eject-mountable-with-operation"></a>eject_mountable_with_operation</code></em> ()</p></td> <td class="struct_member_description"><p>Ejects a mountable object using a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a>. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.eject-mountable-with-operation-finish"></a>eject_mountable_with_operation_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an eject operation using a <a class="link" href="GMountOperation.html" title="GMountOperation"><span class="type">GMountOperation</span></a>. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.poll-mountable"></a>poll_mountable</code></em> ()</p></td> <td class="struct_member_description"><p>Polls a mountable object for media changes. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.poll-mountable-finish"></a>poll_mountable_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes a poll operation for media changes. Since 2.22.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.measure-disk-usage"></a>measure_disk_usage</code></em> ()</p></td> <td class="struct_member_description"><p>Recursively measures the disk usage of <em class="parameter"><code>file</code></em> . Since 2.38</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.measure-disk-usage-async"></a>measure_disk_usage_async</code></em> ()</p></td> <td class="struct_member_description"><p>Asynchronously recursively measures the disk usage of <em class="parameter"><code>file</code></em> . Since 2.38</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="GFileIface.measure-disk-usage-finish"></a>measure_disk_usage_finish</code></em> ()</p></td> <td class="struct_member_description"><p>Finishes an asynchronous recursive measurement of the disk usage of <em class="parameter"><code>file</code></em> . Since 2.38</p></td> <td class="struct_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="GFileQueryInfoFlags"></a><h3>enum GFileQueryInfoFlags</h3> <p>Flags used when querying a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a>.</p> <div class="refsect3"> <a name="GFileQueryInfoFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-FILE-QUERY-INFO-NONE:CAPS"></a>G_FILE_QUERY_INFO_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-QUERY-INFO-NOFOLLOW-SYMLINKS:CAPS"></a>G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS</p></td> <td class="enum_member_description"> <p>Don't follow symlinks.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="GFileCreateFlags"></a><h3>enum GFileCreateFlags</h3> <p>Flags used when an operation may create a file.</p> <div class="refsect3"> <a name="GFileCreateFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-FILE-CREATE-NONE:CAPS"></a>G_FILE_CREATE_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-CREATE-PRIVATE:CAPS"></a>G_FILE_CREATE_PRIVATE</p></td> <td class="enum_member_description"> <p>Create a file that can only be accessed by the current user.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-CREATE-REPLACE-DESTINATION:CAPS"></a>G_FILE_CREATE_REPLACE_DESTINATION</p></td> <td class="enum_member_description"> <p>Replace the destination as if it didn't exist before. Don't try to keep any old permissions, replace instead of following links. This is generally useful if you're doing a "copy over" rather than a "save new version of" replace operation. You can think of it as "unlink destination" before writing to it, although the implementation may not be exactly like that. Since 2.20</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="GFileCopyFlags"></a><h3>enum GFileCopyFlags</h3> <p>Flags used when copying or moving files.</p> <div class="refsect3"> <a name="GFileCopyFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-FILE-COPY-NONE:CAPS"></a>G_FILE_COPY_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-COPY-OVERWRITE:CAPS"></a>G_FILE_COPY_OVERWRITE</p></td> <td class="enum_member_description"> <p>Overwrite any existing files</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-COPY-BACKUP:CAPS"></a>G_FILE_COPY_BACKUP</p></td> <td class="enum_member_description"> <p>Make a backup of any existing files.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-COPY-NOFOLLOW-SYMLINKS:CAPS"></a>G_FILE_COPY_NOFOLLOW_SYMLINKS</p></td> <td class="enum_member_description"> <p>Don't follow symlinks.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-COPY-ALL-METADATA:CAPS"></a>G_FILE_COPY_ALL_METADATA</p></td> <td class="enum_member_description"> <p>Copy all file metadata instead of just default set used for copy (see <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a>).</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-COPY-NO-FALLBACK-FOR-MOVE:CAPS"></a>G_FILE_COPY_NO_FALLBACK_FOR_MOVE</p></td> <td class="enum_member_description"> <p>Don't use copy and delete fallback if native move not supported.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-COPY-TARGET-DEFAULT-PERMS:CAPS"></a>G_FILE_COPY_TARGET_DEFAULT_PERMS</p></td> <td class="enum_member_description"> <p>Leaves target file with default perms, instead of setting the source file perms.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="GFileMonitorFlags"></a><h3>enum GFileMonitorFlags</h3> <p>Flags used to set what a <a class="link" href="GFileMonitor.html" title="GFileMonitor"><span class="type">GFileMonitor</span></a> will watch for.</p> <div class="refsect3"> <a name="GFileMonitorFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-FILE-MONITOR-NONE:CAPS"></a>G_FILE_MONITOR_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-MONITOR-WATCH-MOUNTS:CAPS"></a>G_FILE_MONITOR_WATCH_MOUNTS</p></td> <td class="enum_member_description"> <p>Watch for mount events.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-MONITOR-SEND-MOVED:CAPS"></a>G_FILE_MONITOR_SEND_MOVED</p></td> <td class="enum_member_description"> <p>Pair DELETED and CREATED events caused by file renames (moves) and send a single G_FILE_MONITOR_EVENT_MOVED event instead (NB: not supported on all backends; the default behaviour -without specifying this flag- is to send single DELETED and CREATED events). Deprecated since 2.46: use <a class="link" href="GFile.html#G-FILE-MONITOR-WATCH-MOVES:CAPS"><code class="literal">G_FILE_MONITOR_WATCH_MOVES</code></a> instead.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-MONITOR-WATCH-HARD-LINKS:CAPS"></a>G_FILE_MONITOR_WATCH_HARD_LINKS</p></td> <td class="enum_member_description"> <p>Watch for changes to the file made via another hard link. Since 2.36.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-MONITOR-WATCH-MOVES:CAPS"></a>G_FILE_MONITOR_WATCH_MOVES</p></td> <td class="enum_member_description"> <p>Watch for rename operations on a monitored directory. This causes <a class="link" href="GFileMonitor.html#G-FILE-MONITOR-EVENT-RENAMED:CAPS"><code class="literal">G_FILE_MONITOR_EVENT_RENAMED</code></a>, <a class="link" href="GFileMonitor.html#G-FILE-MONITOR-EVENT-MOVED-IN:CAPS"><code class="literal">G_FILE_MONITOR_EVENT_MOVED_IN</code></a> and <a class="link" href="GFileMonitor.html#G-FILE-MONITOR-EVENT-MOVED-OUT:CAPS"><code class="literal">G_FILE_MONITOR_EVENT_MOVED_OUT</code></a> events to be emitted when possible. Since: 2.46.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="GFileMeasureFlags"></a><h3>enum GFileMeasureFlags</h3> <p>Flags that can be used with <a class="link" href="GFile.html#g-file-measure-disk-usage" title="g_file_measure_disk_usage ()"><code class="function">g_file_measure_disk_usage()</code></a>.</p> <div class="refsect3"> <a name="GFileMeasureFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-FILE-MEASURE-NONE:CAPS"></a>G_FILE_MEASURE_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-MEASURE-REPORT-ANY-ERROR:CAPS"></a>G_FILE_MEASURE_REPORT_ANY_ERROR</p></td> <td class="enum_member_description"> <p>Report any error encountered while traversing the directory tree. Normally errors are only reported for the toplevel file.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-MEASURE-APPARENT-SIZE:CAPS"></a>G_FILE_MEASURE_APPARENT_SIZE</p></td> <td class="enum_member_description"> <p>Tally usage based on apparent file sizes. Normally, the block-size is used, if available, as this is a more accurate representation of disk space used. Compare with <code class="literal">du --apparent-size</code>.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILE-MEASURE-NO-XDEV:CAPS"></a>G_FILE_MEASURE_NO_XDEV</p></td> <td class="enum_member_description"> <p>Do not cross mount point boundaries. Compare with <code class="literal">du -x</code>.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-38.html#api-index-2.38">2.38</a></p> </div> <hr> <div class="refsect2"> <a name="GFilesystemPreviewType"></a><h3>enum GFilesystemPreviewType</h3> <p>Indicates a hint from the file system whether files should be previewed in a file manager. Returned as the value of the key <a class="link" href="GFileInfo.html#G-FILE-ATTRIBUTE-FILESYSTEM-USE-PREVIEW:CAPS" title="G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW"><span class="type">G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW</span></a>.</p> <div class="refsect3"> <a name="GFilesystemPreviewType.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-FILESYSTEM-PREVIEW-TYPE-IF-ALWAYS:CAPS"></a>G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS</p></td> <td class="enum_member_description"> <p>Only preview files if user has explicitly requested it.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILESYSTEM-PREVIEW-TYPE-IF-LOCAL:CAPS"></a>G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL</p></td> <td class="enum_member_description"> <p>Preview files if user has requested preview of "local" files.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-FILESYSTEM-PREVIEW-TYPE-NEVER:CAPS"></a>G_FILESYSTEM_PREVIEW_TYPE_NEVER</p></td> <td class="enum_member_description"> <p>Never preview files.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> </div> <div class="refsect1"> <a name="GFile.see-also"></a><h2>See Also</h2> <p><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a>, <a class="link" href="GFileEnumerator.html" title="GFileEnumerator"><span class="type">GFileEnumerator</span></a></p> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.32</div> </body> </html>