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>GFileInputStream</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="streaming.html" title="Streaming I/O">
9 <link rel="prev" href="GIOStream.html" title="GIOStream">
10 <link rel="next" href="GFileOutputStream.html" title="GFileOutputStream">
11 <meta name="generator" content="GTK-Doc V1.13 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 <link rel="part" href="pt01.html" title="Part I. GIO Overview">
14 <link rel="chapter" href="ch01.html" title="Introduction">
15 <link rel="chapter" href="ch02.html" title="Compiling GIO applications">
16 <link rel="chapter" href="ch03.html" title="Running GIO applications">
17 <link rel="chapter" href="extending-gio.html" title="Extending GIO">
18 <link rel="part" href="pt02.html" title="Part II. API Reference">
19 <link rel="chapter" href="file_ops.html" title="File Operations">
20 <link rel="chapter" href="file_mon.html" title="File System Monitoring">
21 <link rel="chapter" href="async.html" title="Asynchronous I/O">
22 <link rel="chapter" href="conversion.html" title="Data conversion">
23 <link rel="chapter" href="streaming.html" title="Streaming I/O">
24 <link rel="chapter" href="types.html" title="File types and applications">
25 <link rel="chapter" href="volume_mon.html" title="Volumes and Drives">
26 <link rel="chapter" href="icons.html" title="Icons">
27 <link rel="chapter" href="failable_initialization.html" title="Failable Initialization">
28 <link rel="chapter" href="networking.html" title="Lowlevel platform-independent network support">
29 <link rel="chapter" href="resolver.html" title="DNS resolution">
30 <link rel="chapter" href="highlevel-socket.html" title="Highlevel network functionallity">
31 <link rel="chapter" href="utils.html" title="Utilities">
32 <link rel="chapter" href="extending.html" title="Extending GIO">
33 <link rel="part" href="migrating.html" title="Part III. Migrating to GIO">
34 <link rel="chapter" href="ch19.html" title="Migrating from POSIX to GIO">
35 <link rel="chapter" href="ch20.html" title="Migrating from GnomeVFS to GIO">
36 <link rel="chapter" href="gio-hierarchy.html" title="Object Hierarchy">
37 <link rel="index" href="api-index-full.html" title="Index">
38 <link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
39 <link rel="index" href="api-index-2-18.html" title="Index of new symbols in 2.18">
40 <link rel="index" href="api-index-2-20.html" title="Index of new symbols in 2.20">
41 <link rel="index" href="api-index-2-22.html" title="Index of new symbols in 2.22">
42 <link rel="index" href="api-index-2-24.html" title="Index of new symbols in 2.24">
44 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
45 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
47 <td><a accesskey="p" href="GIOStream.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
48 <td><a accesskey="u" href="streaming.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
49 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
50 <th width="100%" align="center">GIO Reference Manual</th>
51 <td><a accesskey="n" href="GFileOutputStream.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
53 <tr><td colspan="5" class="shortcuts">
54 <a href="#GFileInputStream.synopsis" class="shortcut">Top</a>
56 <a href="#GFileInputStream.description" class="shortcut">Description</a>
58 <a href="#GFileInputStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
60 <a href="#GFileInputStream.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
63 <div class="refentry" title="GFileInputStream">
64 <a name="GFileInputStream"></a><div class="titlepage"></div>
65 <div class="refnamediv"><table width="100%"><tr>
67 <h2><span class="refentrytitle"><a name="GFileInputStream.top_of_page"></a>GFileInputStream</span></h2>
68 <p>GFileInputStream — File input streaming operations</p>
70 <td valign="top" align="right"></td>
72 <div class="refsynopsisdiv" title="Synopsis">
73 <a name="GFileInputStream.synopsis"></a><h2>Synopsis</h2>
74 <pre class="synopsis">
75 #include <gio/gio.h>
77 <a class="link" href="GFileInputStream.html#GFileInputStream-struct" title="GFileInputStream">GFileInputStream</a>;
78 <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * <a class="link" href="GFileInputStream.html#g-file-input-stream-query-info" title="g_file_input_stream_query_info ()">g_file_input_stream_query_info</a> (<a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> *stream,
79 const <span class="returnvalue">char</span> *attributes,
80 <a class="link" href="GCancellable.html" title="GCancellable"><span class="returnvalue">GCancellable</span></a> *cancellable,
81 <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);
82 <span class="returnvalue">void</span> <a class="link" href="GFileInputStream.html#g-file-input-stream-query-info-async" title="g_file_input_stream_query_info_async ()">g_file_input_stream_query_info_async</a>
83 (<a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> *stream,
84 const <span class="returnvalue">char</span> *attributes,
85 <span class="returnvalue">int</span> io_priority,
86 <a class="link" href="GCancellable.html" title="GCancellable"><span class="returnvalue">GCancellable</span></a> *cancellable,
87 <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="returnvalue">GAsyncReadyCallback</span></a> callback,
88 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> user_data);
89 <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * <a class="link" href="GFileInputStream.html#g-file-input-stream-query-info-finish" title="g_file_input_stream_query_info_finish ()">g_file_input_stream_query_info_finish</a>
90 (<a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> *stream,
91 <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="returnvalue">GAsyncResult</span></a> *result,
92 <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);
95 <div class="refsect1" title="Object Hierarchy">
96 <a name="GFileInputStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
97 <pre class="synopsis">
98 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
99 +----<a class="link" href="GInputStream.html" title="GInputStream">GInputStream</a>
100 +----GFileInputStream
103 <div class="refsect1" title="Implemented Interfaces">
104 <a name="GFileInputStream.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
106 GFileInputStream implements
107 <a class="link" href="GSeekable.html" title="GSeekable">GSeekable</a>.</p>
109 <div class="refsect1" title="Description">
110 <a name="GFileInputStream.description"></a><h2>Description</h2>
112 GFileInputStream provides input streams that take their
116 GFileInputStream implements <a class="link" href="GSeekable.html" title="GSeekable"><span class="type">GSeekable</span></a>, which allows the input
117 stream to jump to arbitrary positions in the file, provided the
118 filesystem of the file allows it. To find the position of a file
119 input stream, use <a class="link" href="GSeekable.html#g-seekable-tell" title="g_seekable_tell ()"><code class="function">g_seekable_tell()</code></a>. To find out if a file input
120 stream supports seeking, use <code class="function">g_seekable_stream_can_seek()</code>.
121 To position a file input stream, use <a class="link" href="GSeekable.html#g-seekable-seek" title="g_seekable_seek ()"><code class="function">g_seekable_seek()</code></a>.</p>
123 <div class="refsect1" title="Details">
124 <a name="GFileInputStream.details"></a><h2>Details</h2>
125 <div class="refsect2" title="GFileInputStream">
126 <a name="GFileInputStream-struct"></a><h3>GFileInputStream</h3>
127 <pre class="programlisting">typedef struct _GFileInputStream GFileInputStream;</pre>
129 A subclass of GInputStream for opened files. This adds
130 a few file-specific operations and seeking.
133 <a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="type">GFileInputStream</span></a> implements <a class="link" href="GSeekable.html" title="GSeekable"><span class="type">GSeekable</span></a>.</p>
136 <div class="refsect2" title="g_file_input_stream_query_info ()">
137 <a name="g-file-input-stream-query-info"></a><h3>g_file_input_stream_query_info ()</h3>
138 <pre class="programlisting"><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * g_file_input_stream_query_info (<a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> *stream,
139 const <span class="returnvalue">char</span> *attributes,
140 <a class="link" href="GCancellable.html" title="GCancellable"><span class="returnvalue">GCancellable</span></a> *cancellable,
141 <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);</pre>
143 Queries a file input stream the given <em class="parameter"><code>attributes</code></em>. This function blocks
144 while querying the stream. For the asynchronous (non-blocking) version
145 of this function, see <a class="link" href="GFileInputStream.html#g-file-input-stream-query-info-async" title="g_file_input_stream_query_info_async ()"><code class="function">g_file_input_stream_query_info_async()</code></a>. While the
146 stream is blocked, the stream will set the pending flag internally, and
147 any other operations on the stream will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-PENDING:CAPS"><code class="literal">G_IO_ERROR_PENDING</code></a>.</p>
148 <div class="variablelist"><table border="0">
149 <col align="left" valign="top">
152 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
153 <td> a <a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="type">GFileInputStream</span></a>.
157 <td><p><span class="term"><em class="parameter"><code>attributes</code></em> :</span></p></td>
158 <td> a file attribute query string.
162 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
163 <td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.
167 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
168 <td> a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occuring, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
173 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
174 <td> a <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
181 <div class="refsect2" title="g_file_input_stream_query_info_async ()">
182 <a name="g-file-input-stream-query-info-async"></a><h3>g_file_input_stream_query_info_async ()</h3>
183 <pre class="programlisting"><span class="returnvalue">void</span> g_file_input_stream_query_info_async
184 (<a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> *stream,
185 const <span class="returnvalue">char</span> *attributes,
186 <span class="returnvalue">int</span> io_priority,
187 <a class="link" href="GCancellable.html" title="GCancellable"><span class="returnvalue">GCancellable</span></a> *cancellable,
188 <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="returnvalue">GAsyncReadyCallback</span></a> callback,
189 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> user_data);</pre>
191 Queries the stream information asynchronously.
192 When the operation is finished <em class="parameter"><code>callback</code></em> will be called.
193 You can then call <a class="link" href="GFileInputStream.html#g-file-input-stream-query-info-finish" title="g_file_input_stream_query_info_finish ()"><code class="function">g_file_input_stream_query_info_finish()</code></a>
194 to get the result of the operation.
197 For the synchronous version of this function,
198 see <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>.
201 If <em class="parameter"><code>cancellable</code></em> is not <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then the operation can be cancelled by
202 triggering the cancellable object from another thread. If the operation
203 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 set</p>
204 <div class="variablelist"><table border="0">
205 <col align="left" valign="top">
208 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
209 <td> a <a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="type">GFileInputStream</span></a>.
213 <td><p><span class="term"><em class="parameter"><code>attributes</code></em> :</span></p></td>
214 <td> a file attribute query string.
218 <td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
219 <td> the <a class="link" href="gio-GIOScheduler.html#io-priority">I/O priority</a>
224 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
225 <td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.
229 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
230 <td> callback to call when the request is satisfied
234 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
235 <td> the data to pass to callback function
242 <div class="refsect2" title="g_file_input_stream_query_info_finish ()">
243 <a name="g-file-input-stream-query-info-finish"></a><h3>g_file_input_stream_query_info_finish ()</h3>
244 <pre class="programlisting"><a class="link" href="GFileInfo.html" title="GFileInfo"><span class="returnvalue">GFileInfo</span></a> * g_file_input_stream_query_info_finish
245 (<a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="returnvalue">GFileInputStream</span></a> *stream,
246 <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="returnvalue">GAsyncResult</span></a> *result,
247 <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);</pre>
249 Finishes an asynchronous info query operation.</p>
250 <div class="variablelist"><table border="0">
251 <col align="left" valign="top">
254 <td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
255 <td> a <a class="link" href="GFileInputStream.html" title="GFileInputStream"><span class="type">GFileInputStream</span></a>.
259 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
260 <td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.
264 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
265 <td> a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occuring,
266 or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.
270 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
271 <td> <a class="link" href="GFileInfo.html" title="GFileInfo"><span class="type">GFileInfo</span></a>.
278 <div class="refsect1" title="See Also">
279 <a name="GFileInputStream.see-also"></a><h2>See Also</h2>
280 <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>, <a class="link" href="GDataInputStream.html" title="GDataInputStream"><span class="type">GDataInputStream</span></a>, <a class="link" href="GSeekable.html" title="GSeekable"><span class="type">GSeekable</span></a>
285 Generated by GTK-Doc V1.13</div>