ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / doc / html / gnome-vfs-gnome-vfs-file-info-ops.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Getting and Setting File Information</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
2         .synopsis, .classsynopsis {
3             background: #eeeeee;
4             border: solid 1px #aaaaaa;
5             padding: 0.5em;
6         }
7         .programlisting {
8             background: #eeeeff;
9             border: solid 1px #aaaaff;
10             padding: 0.5em;
11         }
12         .variablelist {
13             padding: 4px;
14             margin-left: 3em;
15         }
16         .navigation {
17             background: #ffeeee;
18             border: solid 1px #ffaaaa;
19             margin-top: 0.5em;
20             margin-bottom: 0.5em;
21         }
22         .navigation a {
23             color: #770000;
24         }
25         .navigation a:visited {
26             color: #550000;
27         }
28         .navigation .title {
29             font-size: 200%;
30         }
31       </style><link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library"><link rel="up" href="gnome-vfs-file-operations.html" title="File Handling"><link rel="previous" href="gnome-vfs-gnome-vfs-file-rw-ops.html" title="Reading and Writing"><link rel="next" href="gnome-vfs-gnome-vfs-file-trunc-ops.html" title="Truncating Files"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="gnome-vfs-gnome-vfs-file-rw-ops.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="gnome-vfs-file-operations.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th><td><a accesskey="n" href="gnome-vfs-gnome-vfs-file-trunc-ops.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="gnome-vfs-gnome-vfs-file-info-ops"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Getting and Setting File Information</span></h2><p>Getting and Setting File Information &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
32
33
34
35 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-file-info-ops.html#gnome-vfs-get-file-info">gnome_vfs_get_file_info</a>      (const <a
36 href="../glib/glib-Basic-Types.html#gchar"
37 >gchar</a> *text_uri,
38                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
39                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);
40 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-file-info-ops.html#gnome-vfs-get-file-info-uri">gnome_vfs_get_file_info_uri</a>  (GnomeVFSURI *uri,
41                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
42                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);
43 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-file-info-ops.html#gnome-vfs-get-file-info-from-handle">gnome_vfs_get_file_info_from_handle</a>
44                                             (GnomeVFSHandle *handle,
45                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
46                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);
47 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-file-info-ops.html#gnome-vfs-set-file-info-uri">gnome_vfs_set_file_info_uri</a>  (GnomeVFSURI *uri,
48                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
49                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask);
50 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-file-info-ops.html#gnome-vfs-set-file-info">gnome_vfs_set_file_info</a>      (const <a
51 href="../glib/glib-Basic-Types.html#gchar"
52 >gchar</a> *text_uri,
53                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
54                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask);
55 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
56     Applications can use the <a href="gnome-vfs-gnome-vfs-file-info-ops.html#gnome-vfs-get-file-info">gnome_vfs_get_file_info</a> family of operations to
57     retrieve file information, as this operation can be quite costly in
58     terms of time (specilly when sniffing the MIME type) applications can 
59     specify which information need at any time, reducing the performance 
60     impact.
61 </p><p>
62     All of these operations use a <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> data structure that holds 
63     the file information, there are several methods that can be used to 
64     manipulate this information. See <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> for more information.
65 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-file-info"></a>gnome_vfs_get_file_info ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_get_file_info      (const <a
66 href="../glib/glib-Basic-Types.html#gchar"
67 >gchar</a> *text_uri,
68                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
69                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);</pre><p>
70 Retrieve information about <i class="parameter"><tt>text_uri</tt></i>.  The information will be stored in
71 <i class="parameter"><tt>info</tt></i>.</p><p>
72
73 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>text_uri</tt></i> :</span></td><td> URI of the file for which information will be retrieved
74 </td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i> :</span></td><td> Pointer to a GnomeVFSFileInfo object that will hold the information
75 for the file on return
76 </td></tr><tr><td><span class="term"><i class="parameter"><tt>options</tt></i> :</span></td><td> Options for retrieving file information
77 to retrieve for the file
78 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> An integer representing the result of the operation
79 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-file-info-uri"></a>gnome_vfs_get_file_info_uri ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_get_file_info_uri  (GnomeVFSURI *uri,
80                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
81                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);</pre><p>
82 Retrieve information about <i class="parameter"><tt>text_uri</tt></i>.  The information will be stored in
83 <i class="parameter"><tt>info</tt></i>.</p><p>
84
85 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> URI of the file for which information will be retrieved
86 </td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i> :</span></td><td> Pointer to a GnomeVFSFileInfo object that will hold the information
87 for the file on return
88 </td></tr><tr><td><span class="term"><i class="parameter"><tt>options</tt></i> :</span></td><td> Options for retrieving file information
89 to retrieve for the file
90 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> An integer representing the result of the operation
91 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-get-file-info-from-handle"></a>gnome_vfs_get_file_info_from_handle ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_get_file_info_from_handle
92                                             (GnomeVFSHandle *handle,
93                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
94                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options);</pre><p>
95 Retrieve information about an open file.  The information will be stored in
96 <i class="parameter"><tt>info</tt></i>.</p><p>
97
98 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle</tt></i> :</span></td><td> Handle of the file for which information must be retrieved
99 </td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i> :</span></td><td> Pointer to a GnomeVFSFileInfo object that will hold the information
100 for the file on return
101 </td></tr><tr><td><span class="term"><i class="parameter"><tt>options</tt></i> :</span></td><td> Options for retrieving file information
102 to retrieve for the file
103 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> An integer representing the result of the operation
104 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-set-file-info-uri"></a>gnome_vfs_set_file_info_uri ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_set_file_info_uri  (GnomeVFSURI *uri,
105                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
106                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask);</pre><p>
107 Set file information for <i class="parameter"><tt>uri</tt></i>; only the information for which the
108 corresponding bit in <i class="parameter"><tt>mask</tt></i> is set is actually modified.</p><p>
109
110 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> A URI
111 </td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i> :</span></td><td> Information that must be set for the file
112 </td></tr><tr><td><span class="term"><i class="parameter"><tt>mask</tt></i> :</span></td><td> Bit mask representing which fields of <i class="parameter"><tt>info</tt></i> need to be set 
113 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> An integer representing the result of the operation.
114 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-set-file-info"></a>gnome_vfs_set_file_info ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_set_file_info      (const <a
115 href="../glib/glib-Basic-Types.html#gchar"
116 >gchar</a> *text_uri,
117                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
118                                              <a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask);</pre><p>
119 Set file information for <i class="parameter"><tt>uri</tt></i>; only the information for which the
120 corresponding bit in <i class="parameter"><tt>mask</tt></i> is set is actually modified.</p><p>
121
122 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>text_uri</tt></i> :</span></td><td> A URI
123 </td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i> :</span></td><td> Information that must be set for the file
124 </td></tr><tr><td><span class="term"><i class="parameter"><tt>mask</tt></i> :</span></td><td> Bit mask representing which fields of <i class="parameter"><tt>info</tt></i> need to be set 
125 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> An integer representing the result of the operation.
126 </td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><h2>See Also</h2><p>
127
128 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><a href="gnome-vfs-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a></span></td><td></td></tr></tbody></table></div><p>
129
130 </p></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="gnome-vfs-gnome-vfs-file-rw-ops.html"><b>&lt;&lt; Reading and Writing</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-gnome-vfs-file-trunc-ops.html"><b>Truncating Files &gt;&gt;</b></a></td></tr></table></body></html>