<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GFileInputStream">
<refmeta>
<refentrytitle role="top_of_page" id="GFileInputStream.top_of_page">GFileInputStream</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GFileInputStream</refname>
<refpurpose>File input streaming operations</refpurpose>
</refnamediv>

<refsynopsisdiv id="GFileInputStream.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gio/gio.h&gt;

                    <link linkend="GFileInputStream-struct">GFileInputStream</link>;
<link linkend="GFileInfo">GFileInfo</link> *         <link linkend="g-file-input-stream-query-info">g_file_input_stream_query_info</link>      (<link linkend="GFileInputStream">GFileInputStream</link> *stream,
                                                         const <link linkend="char">char</link> *attributes,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-file-input-stream-query-info-async">g_file_input_stream_query_info_async</link>
                                                        (<link linkend="GFileInputStream">GFileInputStream</link> *stream,
                                                         const <link linkend="char">char</link> *attributes,
                                                         <link linkend="int">int</link> io_priority,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="GFileInfo">GFileInfo</link> *         <link linkend="g-file-input-stream-query-info-finish">g_file_input_stream_query_info_finish</link>
                                                        (<link linkend="GFileInputStream">GFileInputStream</link> *stream,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GFileInputStream.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GInputStream">GInputStream</link>
         +----GFileInputStream
</synopsis>
</refsect1>



<refsect1 id="GFileInputStream.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GFileInputStream implements
 <link linkend="GSeekable">GSeekable</link>.</para>
</refsect1>





<refsect1 id="GFileInputStream.description" role="desc">
<title role="desc.title">Description</title>
<para>
GFileInputStream provides input streams that take their
content from a file.
</para>
<para>
GFileInputStream implements <link linkend="GSeekable"><type>GSeekable</type></link>, which allows the input 
stream to jump to arbitrary positions in the file, provided the 
filesystem of the file allows it. To find the position of a file
input stream, use <link linkend="g-seekable-tell"><function>g_seekable_tell()</function></link>. To find out if a file input
stream supports seeking, use <link linkend="g-seekable-stream-can-seek"><function>g_seekable_stream_can_seek()</function></link>.
To position a file input stream, use <link linkend="g-seekable-seek"><function>g_seekable_seek()</function></link>.</para>
<para>
</para>
</refsect1>

<refsect1 id="GFileInputStream.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GFileInputStream-struct" role="struct">
<title>GFileInputStream</title>
<indexterm zone="GFileInputStream-struct"><primary sortas="FileInputStream">GFileInputStream</primary></indexterm><programlisting>typedef struct _GFileInputStream GFileInputStream;</programlisting>
<para>
A subclass of GInputStream for opened files. This adds
a few file-specific operations and seeking.
</para>
<para>
<link linkend="GFileInputStream"><type>GFileInputStream</type></link> implements <link linkend="GSeekable"><type>GSeekable</type></link>.</para>
<para>
</para></refsect2>
<refsect2 id="g-file-input-stream-query-info" role="function">
<title>g_file_input_stream_query_info ()</title>
<indexterm zone="g-file-input-stream-query-info"><primary sortas="file_input_stream_query_info">g_file_input_stream_query_info</primary></indexterm><programlisting><link linkend="GFileInfo">GFileInfo</link> *         g_file_input_stream_query_info      (<link linkend="GFileInputStream">GFileInputStream</link> *stream,
                                                         const <link linkend="char">char</link> *attributes,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Queries a file input stream the given <parameter>attributes</parameter>. This function blocks 
while querying the stream. For the asynchronous (non-blocking) version 
of this function, see <link linkend="g-file-input-stream-query-info-async"><function>g_file_input_stream_query_info_async()</function></link>. While the 
stream is blocked, the stream will set the pending flag internally, and 
any other operations on the stream will fail with <link linkend="G-IO-ERROR-PENDING--CAPS"><literal>G_IO_ERROR_PENDING</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GFileInputStream"><type>GFileInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>attributes</parameter>&#160;:</term>
<listitem><simpara> a file attribute query string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore. 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to 
ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GFileInfo"><type>GFileInfo</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-file-input-stream-query-info-async" role="function">
<title>g_file_input_stream_query_info_async ()</title>
<indexterm zone="g-file-input-stream-query-info-async"><primary sortas="file_input_stream_query_info_async">g_file_input_stream_query_info_async</primary></indexterm><programlisting><link linkend="void">void</link>                g_file_input_stream_query_info_async
                                                        (<link linkend="GFileInputStream">GFileInputStream</link> *stream,
                                                         const <link linkend="char">char</link> *attributes,
                                                         <link linkend="int">int</link> io_priority,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Queries the stream information asynchronously.
When the operation is finished <parameter>callback</parameter> will be called. 
You can then call <link linkend="g-file-input-stream-query-info-finish"><function>g_file_input_stream_query_info_finish()</function></link> 
to get the result of the operation.
</para>
<para>
For the synchronous version of this function, 
see <link linkend="g-file-input-stream-query-info"><function>g_file_input_stream_query_info()</function></link>. 
</para>
<para>
If <parameter>cancellable</parameter> is not <link linkend="NULL--CAPS"><literal>NULL</literal></link>, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error <link linkend="G-IO-ERROR-CANCELLED--CAPS"><literal>G_IO_ERROR_CANCELLED</literal></link> will be set</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GFileInputStream"><type>GFileInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>attributes</parameter>&#160;:</term>
<listitem><simpara> a file attribute query string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>io_priority</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="io-priority">I/O priority</link> 
    of the request.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore. 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&#160;:</term>
<listitem><simpara> callback to call when the request is satisfied
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara> the data to pass to callback function
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-file-input-stream-query-info-finish" role="function">
<title>g_file_input_stream_query_info_finish ()</title>
<indexterm zone="g-file-input-stream-query-info-finish"><primary sortas="file_input_stream_query_info_finish">g_file_input_stream_query_info_finish</primary></indexterm><programlisting><link linkend="GFileInfo">GFileInfo</link> *         g_file_input_stream_query_info_finish
                                                        (<link linkend="GFileInputStream">GFileInputStream</link> *stream,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *result,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes an asynchronous info query operation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GFileInputStream"><type>GFileInputStream</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, 
    or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="GFileInfo"><type>GFileInfo</type></link>. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>



<refsect1 id="GFileInputStream.see-also">
<title>See Also</title>
#GInputStream, <link linkend="GDataInputStream"><type>GDataInputStream</type></link>, <link linkend="GSeekable"><type>GSeekable</type></link>
</refsect1>

</refentry>
