<refentry id="gnome-vfs-20-gnome-vfs-file-trunc-ops">
<refmeta>
<refentrytitle id="top_of_page">Truncating Files</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GNOME-VFS-2.0 Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Truncating Files</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-truncate">gnome_vfs_truncate</link>           (const <link linkend="gchar">gchar</link> *text_uri,
                                             <link linkend="GnomeVFSFileSize">GnomeVFSFileSize</link> length);
<link linkend="GnomeVFSResult">GnomeVFSResult</link> <link linkend="gnome-vfs-truncate-uri">gnome_vfs_truncate_uri</link>       (<link linkend="GnomeVFSURI">GnomeVFSURI</link> *uri,
                                             <link linkend="GnomeVFSFileSize">GnomeVFSFileSize</link> length);
<link linkend="GnomeVFSResult">GnomeVFSResult</link> <link linkend="gnome-vfs-truncate-handle">gnome_vfs_truncate_handle</link>    (<link linkend="GnomeVFSHandle">GnomeVFSHandle</link> *handle,
                                             <link linkend="GnomeVFSFileSize">GnomeVFSFileSize</link> length);
</synopsis>
</refsynopsisdiv>









<refsect1 id="desc">
<title id="desc.title">Description</title>
<para>

</para>
</refsect1>

<refsect1 id="details">
<title id="details.title">Details</title>
<refsect2>
<title><anchor id="gnome-vfs-truncate" role="function"/>gnome_vfs_truncate ()</title>
<indexterm><primary>gnome_vfs_truncate</primary></indexterm><programlisting><link linkend="GnomeVFSResult">GnomeVFSResult</link> gnome_vfs_truncate           (const <link linkend="gchar">gchar</link> *text_uri,
                                             <link linkend="GnomeVFSFileSize">GnomeVFSFileSize</link> length);</programlisting>
<para>
Truncate the file at <parameter>text_uri</parameter> to <parameter>length</parameter> bytes.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>text_uri</parameter>&nbsp;:</term>
<listitem><simpara> string representing the file to be truncated.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&nbsp;:</term>
<listitem><simpara> length of the new file at <parameter>text_uri</parameter>.
</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-truncate-uri" role="function"/>gnome_vfs_truncate_uri ()</title>
<indexterm><primary>gnome_vfs_truncate_uri</primary></indexterm><programlisting><link linkend="GnomeVFSResult">GnomeVFSResult</link> gnome_vfs_truncate_uri       (<link linkend="GnomeVFSURI">GnomeVFSURI</link> *uri,
                                             <link linkend="GnomeVFSFileSize">GnomeVFSFileSize</link> length);</programlisting>
<para>
Truncate the file at <parameter>uri</parameter> to be only <parameter>length</parameter> bytes. Data past <parameter>length</parameter>
bytes will be discarded.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
<listitem><simpara> uri of the file to be truncated.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&nbsp;:</term>
<listitem><simpara> length of the new file at <parameter>uri</parameter>.
</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-truncate-handle" role="function"/>gnome_vfs_truncate_handle ()</title>
<indexterm><primary>gnome_vfs_truncate_handle</primary></indexterm><programlisting><link linkend="GnomeVFSResult">GnomeVFSResult</link> gnome_vfs_truncate_handle    (<link linkend="GnomeVFSHandle">GnomeVFSHandle</link> *handle,
                                             <link linkend="GnomeVFSFileSize">GnomeVFSFileSize</link> length);</programlisting>
<para>
Truncate the file pointed to by <parameter>handle</parameter> to be only <parameter>length</parameter> bytes. 
Data past <parameter>length</parameter> bytes will be discarded.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>handle</parameter>&nbsp;:</term>
<listitem><simpara> a handle to the file to be truncated.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length</parameter>&nbsp;:</term>
<listitem><simpara> length of the new file the handle is open to.
</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>




</refentry>
