<refentry id="gnome-vfs-20-gnome-vfs-file-info-ops">
<refmeta>
<refentrytitle id="top_of_page">Getting and Setting File Information</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GNOME-VFS-2.0 Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Getting and Setting File Information</refname>
<refpurpose></refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

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

<synopsis>



<link linkend="GnomeVFSResult">GnomeVFSResult</link> <link linkend="gnome-vfs-get-file-info">gnome_vfs_get_file_info</link>      (const <link linkend="gchar">gchar</link> *text_uri,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</link> options);
<link linkend="GnomeVFSResult">GnomeVFSResult</link> <link linkend="gnome-vfs-get-file-info-uri">gnome_vfs_get_file_info_uri</link>  (<link linkend="GnomeVFSURI">GnomeVFSURI</link> *uri,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</link> options);
<link linkend="GnomeVFSResult">GnomeVFSResult</link> <link linkend="gnome-vfs-get-file-info-from-handle">gnome_vfs_get_file_info_from_handle</link>
                                            (<link linkend="GnomeVFSHandle">GnomeVFSHandle</link> *handle,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</link> options);
<link linkend="GnomeVFSResult">GnomeVFSResult</link> <link linkend="gnome-vfs-set-file-info-uri">gnome_vfs_set_file_info_uri</link>  (<link linkend="GnomeVFSURI">GnomeVFSURI</link> *uri,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</link> mask);
<link linkend="GnomeVFSResult">GnomeVFSResult</link> <link linkend="gnome-vfs-set-file-info">gnome_vfs_set_file_info</link>      (const <link linkend="gchar">gchar</link> *text_uri,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</link> mask);
</synopsis>
</refsynopsisdiv>









<refsect1 id="desc">
<title id="desc.title">Description</title>
<para>
    Applications can use the <link linkend="gnome-vfs-get-file-info"><type>gnome_vfs_get_file_info</type></link> family of operations to
    retrieve file information, as this operation can be quite costly in
    terms of time (specilly when sniffing the MIME type) applications can 
    specify which information need at any time, reducing the performance 
    impact.
</para>
<para>
    All of these operations use a <link linkend="GnomeVFSFileInfo"><type>GnomeVFSFileInfo</type></link> data structure that holds 
    the file information, there are several methods that can be used to 
    manipulate this information. See <link linkend="GnomeVFSFileInfo"><type>GnomeVFSFileInfo</type></link> for more information.
</para>
</refsect1>

<refsect1 id="details">
<title id="details.title">Details</title>
<refsect2>
<title><anchor id="gnome-vfs-get-file-info" role="function"/>gnome_vfs_get_file_info ()</title>
<indexterm><primary>gnome_vfs_get_file_info</primary></indexterm><programlisting><link linkend="GnomeVFSResult">GnomeVFSResult</link> gnome_vfs_get_file_info      (const <link linkend="gchar">gchar</link> *text_uri,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</link> options);</programlisting>
<para>
Retrieve information about <parameter>text_uri</parameter>.  The information will be stored in
<parameter>info</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>text_uri</parameter>&nbsp;:</term>
<listitem><simpara> uri of the file for which information will be retrieved.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter>&nbsp;:</term>
<listitem><simpara> pointer to a <link linkend="GnomeVFSFileInfo"><type>GnomeVFSFileInfo</type></link> object that will hold the information
for the file on return.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>options</parameter>&nbsp;:</term>
<listitem><simpara> options for retrieving file information.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> an integer representing the result of the operation.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gnome-vfs-get-file-info-uri" role="function"/>gnome_vfs_get_file_info_uri ()</title>
<indexterm><primary>gnome_vfs_get_file_info_uri</primary></indexterm><programlisting><link linkend="GnomeVFSResult">GnomeVFSResult</link> gnome_vfs_get_file_info_uri  (<link linkend="GnomeVFSURI">GnomeVFSURI</link> *uri,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</link> options);</programlisting>
<para>
Retrieve information about <parameter>text_uri</parameter>.  The information will be stored in
<parameter>info</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
<listitem><simpara> uri of the file for which information will be retrieved.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter>&nbsp;:</term>
<listitem><simpara> pointer to a <link linkend="GnomeVFSFileInfo"><type>GnomeVFSFileInfo</type></link> object that will hold the information
for the file on return.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>options</parameter>&nbsp;:</term>
<listitem><simpara> options for retrieving file information.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> an integer representing the result of the operation.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gnome-vfs-get-file-info-from-handle" role="function"/>gnome_vfs_get_file_info_from_handle ()</title>
<indexterm><primary>gnome_vfs_get_file_info_from_handle</primary></indexterm><programlisting><link linkend="GnomeVFSResult">GnomeVFSResult</link> gnome_vfs_get_file_info_from_handle
                                            (<link linkend="GnomeVFSHandle">GnomeVFSHandle</link> *handle,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</link> options);</programlisting>
<para>
Retrieve information about an open file.  The information will be stored in
<parameter>info</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>handle</parameter>&nbsp;:</term>
<listitem><simpara> handle of the file for which information must be retrieved.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter>&nbsp;:</term>
<listitem><simpara> pointer to a <link linkend="GnomeVFSFileInfo"><type>GnomeVFSFileInfo</type></link> object that will hold the information
for the file on return.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>options</parameter>&nbsp;:</term>
<listitem><simpara> options for retrieving file information.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> an integer representing the result of the operation.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gnome-vfs-set-file-info-uri" role="function"/>gnome_vfs_set_file_info_uri ()</title>
<indexterm><primary>gnome_vfs_set_file_info_uri</primary></indexterm><programlisting><link linkend="GnomeVFSResult">GnomeVFSResult</link> gnome_vfs_set_file_info_uri  (<link linkend="GnomeVFSURI">GnomeVFSURI</link> *uri,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</link> mask);</programlisting>
<para>
Set file information for <parameter>uri</parameter>; only the information for which the
corresponding bit in <parameter>mask</parameter> is set is actually modified.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
<listitem><simpara> a uri.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter>&nbsp;:</term>
<listitem><simpara> information that must be set for the file.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mask</parameter>&nbsp;:</term>
<listitem><simpara> bit mask representing which fields of <parameter>info</parameter> need to be set.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> an integer representing the result of the operation.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gnome-vfs-set-file-info" role="function"/>gnome_vfs_set_file_info ()</title>
<indexterm><primary>gnome_vfs_set_file_info</primary></indexterm><programlisting><link linkend="GnomeVFSResult">GnomeVFSResult</link> gnome_vfs_set_file_info      (const <link linkend="gchar">gchar</link> *text_uri,
                                             <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *info,
                                             <link linkend="GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</link> mask);</programlisting>
<para>
Set file information for <parameter>uri</parameter>; only the information for which the
corresponding bit in <parameter>mask</parameter> is set is actually modified.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>text_uri</parameter>&nbsp;:</term>
<listitem><simpara> string representing the file location.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter>&nbsp;:</term>
<listitem><simpara> information that must be set for the file.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mask</parameter>&nbsp;:</term>
<listitem><simpara> bit mask representing which fields of <parameter>info</parameter> need to be set.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> an integer representing the result of the operation.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>



<refsect1>
<title>See Also</title>
<para>

<variablelist>
<varlistentry>
<term><link linkend="GnomeVFSFileInfo"><type>GnomeVFSFileInfo</type></link></term>
</varlistentry>
</variablelist>

</para>
</refsect1>

</refentry>
