1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>Getting and Setting File Information</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
<link rel="start" href="index.html" title="GnomeVFS - Filesystem Abstraction library">
8
<link rel="up" href="gnome-vfs-basic-file-ops.html" title="File Operations">
9
<link rel="prev" href="gnome-vfs-20-gnome-vfs-file-trunc-ops.html" title="Truncating Files">
10
<link rel="next" href="gnome-vfs-directory-ops.html" title="Directory-Specific Operations">
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="about.html" title="Introduction to GnomeVFS">
14
<link rel="chapter" href="data-types.html" title="Basic Data Types">
15
<link rel="chapter" href="gnome-vfs-basic-file-ops.html" title="File Operations">
16
<link rel="chapter" href="gnome-vfs-directory-ops.html" title="Directory-Specific Operations">
17
<link rel="chapter" href="gnome-vfs-file-and-dirs-ops.html" title="Advanced File/Directory Operations">
18
<link rel="chapter" href="gnome-vfs-file-async-ops.html" title="Asynchronous Operations">
19
<link rel="chapter" href="volumes.html" title="Volumes and Drives Handling">
20
<link rel="chapter" href="networking.html" title="Networking">
21
<link rel="chapter" href="mime-registry.html" title="MIME Registry">
22
<link rel="chapter" href="modules.html" title="Filesystem Modules">
24
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
27
<td><a accesskey="p" href="gnome-vfs-20-gnome-vfs-file-trunc-ops.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
28
<td><a accesskey="u" href="gnome-vfs-basic-file-ops.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
29
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
30
<th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th>
31
<td><a accesskey="n" href="gnome-vfs-directory-ops.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
33
<tr><td colspan="5" class="shortcuts">
34
<a href="#gnome-vfs-20-gnome-vfs-file-info-ops.synopsis" class="shortcut">Top</a>
36
<a href="#gnome-vfs-20-gnome-vfs-file-info-ops.description" class="shortcut">Description</a>
39
<div class="refentry" lang="en">
40
<a name="gnome-vfs-20-gnome-vfs-file-info-ops"></a><div class="titlepage"></div>
41
<div class="refnamediv"><table width="100%"><tr>
43
<h2><span class="refentrytitle"><a name="gnome-vfs-20-gnome-vfs-file-info-ops.top_of_page"></a>Getting and Setting File Information</span></h2>
44
<p>Getting and Setting File Information — Convenient high-level abstraction for obtaining and setting file information, including ACLs.</p>
46
<td valign="top" align="right"></td>
48
<div class="refsynopsisdiv">
49
<a name="gnome-vfs-20-gnome-vfs-file-info-ops.synopsis"></a><h2>Synopsis</h2>
50
<pre class="synopsis">
51
<a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-20-gnome-vfs-file-info-ops.html#gnome-vfs-get-file-info" title="gnome_vfs_get_file_info ()">gnome_vfs_get_file_info</a> (const gchar *text_uri,
52
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
53
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions" title="enum GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);
54
<a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-20-gnome-vfs-file-info-ops.html#gnome-vfs-get-file-info-uri" title="gnome_vfs_get_file_info_uri ()">gnome_vfs_get_file_info_uri</a> (<a class="link" href="gnome-vfs-20-gnome-vfs-uri.html#GnomeVFSURI" title="GnomeVFSURI">GnomeVFSURI</a> *uri,
55
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
56
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions" title="enum GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);
57
<a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-20-gnome-vfs-file-info-ops.html#gnome-vfs-get-file-info-from-handle" title="gnome_vfs_get_file_info_from_handle ()">gnome_vfs_get_file_info_from_handle</a> (GnomeVFSHandle *handle,
58
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
59
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions" title="enum GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);
60
<a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-20-gnome-vfs-file-info-ops.html#gnome-vfs-set-file-info-uri" title="gnome_vfs_set_file_info_uri ()">gnome_vfs_set_file_info_uri</a> (<a class="link" href="gnome-vfs-20-gnome-vfs-uri.html#GnomeVFSURI" title="GnomeVFSURI">GnomeVFSURI</a> *uri,
61
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
62
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask" title="enum GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask);
63
<a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> <a class="link" href="gnome-vfs-20-gnome-vfs-file-info-ops.html#gnome-vfs-set-file-info" title="gnome_vfs_set_file_info ()">gnome_vfs_set_file_info</a> (const gchar *text_uri,
64
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
65
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask" title="enum GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask);
68
<div class="refsect1" lang="en">
69
<a name="gnome-vfs-20-gnome-vfs-file-info-ops.description"></a><h2>Description</h2>
71
Applications can use the <a class="link" href="gnome-vfs-20-gnome-vfs-file-info-ops.html#gnome-vfs-get-file-info" title="gnome_vfs_get_file_info ()"><code class="function">gnome_vfs_get_file_info()</code></a> family of operations to
72
retrieve file information, as this operation can be quite costly in
73
terms of time (specilly when sniffing the MIME type) applications can
74
specify which information need at any time, reducing the performance
78
All of these operations use a <a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo"><span class="type">GnomeVFSFileInfo</span></a> data structure that holds
79
the file information, there are several methods that can be used to
80
manipulate this information. See <a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo"><span class="type">GnomeVFSFileInfo</span></a> for more information.
83
<div class="refsect1" lang="en">
84
<a name="gnome-vfs-20-gnome-vfs-file-info-ops.details"></a><h2>Details</h2>
85
<div class="refsect2" lang="en">
86
<a name="gnome-vfs-get-file-info"></a><h3>gnome_vfs_get_file_info ()</h3>
87
<pre class="programlisting"><a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_get_file_info (const gchar *text_uri,
88
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
89
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions" title="enum GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);</pre>
91
Retrieve information about <em class="parameter"><code>text_uri</code></em>. The information will be stored in
92
<em class="parameter"><code>info</code></em>.</p>
95
<div class="variablelist"><table border="0">
96
<col align="left" valign="top">
99
<td><p><span class="term"><em class="parameter"><code>text_uri</code></em> :</span></p></td>
100
<td> uri of the file for which information will be retrieved.
104
<td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
105
<td> pointer to a <a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo"><span class="type">GnomeVFSFileInfo</span></a> object that will hold the information
106
for the file on return.
110
<td><p><span class="term"><em class="parameter"><code>options</code></em> :</span></p></td>
111
<td> options for retrieving file information.
115
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
116
<td> an integer representing the result of the operation.
123
<div class="refsect2" lang="en">
124
<a name="gnome-vfs-get-file-info-uri"></a><h3>gnome_vfs_get_file_info_uri ()</h3>
125
<pre class="programlisting"><a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_get_file_info_uri (<a class="link" href="gnome-vfs-20-gnome-vfs-uri.html#GnomeVFSURI" title="GnomeVFSURI">GnomeVFSURI</a> *uri,
126
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
127
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions" title="enum GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);</pre>
129
Retrieve information about <em class="parameter"><code>text_uri</code></em>. The information will be stored in
130
<em class="parameter"><code>info</code></em>.</p>
133
<div class="variablelist"><table border="0">
134
<col align="left" valign="top">
137
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
138
<td> uri of the file for which information will be retrieved.
142
<td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
143
<td> pointer to a <a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo"><span class="type">GnomeVFSFileInfo</span></a> object that will hold the information
144
for the file on return.
148
<td><p><span class="term"><em class="parameter"><code>options</code></em> :</span></p></td>
149
<td> options for retrieving file information.
153
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
154
<td> an integer representing the result of the operation.
161
<div class="refsect2" lang="en">
162
<a name="gnome-vfs-get-file-info-from-handle"></a><h3>gnome_vfs_get_file_info_from_handle ()</h3>
163
<pre class="programlisting"><a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_get_file_info_from_handle (GnomeVFSHandle *handle,
164
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
165
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions" title="enum GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);</pre>
167
Retrieve information about an open file. The information will be stored in
168
<em class="parameter"><code>info</code></em>.</p>
171
<div class="variablelist"><table border="0">
172
<col align="left" valign="top">
175
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
176
<td> handle of the file for which information must be retrieved.
180
<td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
181
<td> pointer to a <a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo"><span class="type">GnomeVFSFileInfo</span></a> object that will hold the information
182
for the file on return.
186
<td><p><span class="term"><em class="parameter"><code>options</code></em> :</span></p></td>
187
<td> options for retrieving file information.
191
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
192
<td> an integer representing the result of the operation.
199
<div class="refsect2" lang="en">
200
<a name="gnome-vfs-set-file-info-uri"></a><h3>gnome_vfs_set_file_info_uri ()</h3>
201
<pre class="programlisting"><a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_set_file_info_uri (<a class="link" href="gnome-vfs-20-gnome-vfs-uri.html#GnomeVFSURI" title="GnomeVFSURI">GnomeVFSURI</a> *uri,
202
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
203
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask" title="enum GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask);</pre>
205
Set file information for <em class="parameter"><code>uri</code></em>; only the information for which the
206
corresponding bit in <em class="parameter"><code>mask</code></em> is set is actually modified.
210
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
211
<h3 class="title">Note</h3>
212
<em class="parameter"><code>info</code></em>'s <code class="literal">valid_fields</code> is not required to contain the
213
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoFields" title="enum GnomeVFSFileInfoFields"><span class="type">GnomeVFSFileInfoFields</span></a> corresponding to the specified
214
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask" title="enum GnomeVFSSetFileInfoMask"><span class="type">GnomeVFSSetFileInfoMask</span></a> fields of <em class="parameter"><code>mask</code></em>. It
215
is assumed that the <em class="parameter"><code>info</code></em> fields referenced by <em class="parameter"><code>mask</code></em>
220
<div class="variablelist"><table border="0">
221
<col align="left" valign="top">
224
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
229
<td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
230
<td> information that must be set for the file.
234
<td><p><span class="term"><em class="parameter"><code>mask</code></em> :</span></p></td>
235
<td> bit mask representing which fields of <em class="parameter"><code>info</code></em> need to be set.
239
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
240
<td> an integer representing the result of the operation.
247
<div class="refsect2" lang="en">
248
<a name="gnome-vfs-set-file-info"></a><h3>gnome_vfs_set_file_info ()</h3>
249
<pre class="programlisting"><a class="link" href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_set_file_info (const gchar *text_uri,
250
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
251
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask" title="enum GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask);</pre>
253
Set file information for <em class="parameter"><code>uri</code></em>; only the information for which the
254
corresponding bit in <em class="parameter"><code>mask</code></em> is set is actually modified.
258
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
259
<h3 class="title">Note</h3>
260
<em class="parameter"><code>info</code></em>'s <code class="literal">valid_fields</code> is not required to contain the
261
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoFields" title="enum GnomeVFSFileInfoFields"><span class="type">GnomeVFSFileInfoFields</span></a> corresponding to the specified
262
<a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask" title="enum GnomeVFSSetFileInfoMask"><span class="type">GnomeVFSSetFileInfoMask</span></a> fields of <em class="parameter"><code>mask</code></em>. It
263
is assumed that the <em class="parameter"><code>info</code></em> fields referenced by <em class="parameter"><code>mask</code></em>
268
<div class="variablelist"><table border="0">
269
<col align="left" valign="top">
272
<td><p><span class="term"><em class="parameter"><code>text_uri</code></em> :</span></p></td>
273
<td> string representing the file location.
277
<td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
278
<td> information that must be set for the file.
282
<td><p><span class="term"><em class="parameter"><code>mask</code></em> :</span></p></td>
283
<td> bit mask representing which fields of <em class="parameter"><code>info</code></em> need to be set.
287
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
288
<td> an integer representing the result of the operation.
295
<div class="refsect1" lang="en">
296
<a name="gnome-vfs-20-gnome-vfs-file-info-ops.see-also"></a><h2>See Also</h2>
299
<div class="variablelist"><table border="0">
300
<col align="left" valign="top">
302
<td><p><span class="term"><a class="link" href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo" title="GnomeVFSFileInfo"><span class="type">GnomeVFSFileInfo</span></a></span></p></td>
312
Generated by GTK-Doc V1.11</div>