1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Truncating Files</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 {
4 border: solid 1px #aaaaaa;
9 border: solid 1px #aaaaff;
18 border: solid 1px #ffaaaa;
25 .navigation a:visited {
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-info-ops.html" title="Getting and Setting File Information"><link rel="next" href="gnome-vfs-gnome-vfs-file-advanced-ops.html" title="Advanced File Operations"></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-info-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-advanced-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-trunc-ops"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Truncating Files</span></h2><p>Truncating Files — </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
35 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-file-trunc-ops.html#gnome-vfs-truncate">gnome_vfs_truncate</a> (const <a
36 href="../glib/glib-Basic-Types.html#gchar"
38 <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> length);
39 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-file-trunc-ops.html#gnome-vfs-truncate-uri">gnome_vfs_truncate_uri</a> (GnomeVFSURI *uri,
40 <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> length);
41 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-file-trunc-ops.html#gnome-vfs-truncate-handle">gnome_vfs_truncate_handle</a> (GnomeVFSHandle *handle,
42 <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> length);
43 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
45 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="gnome-vfs-truncate"></a>gnome_vfs_truncate ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_truncate (const <a
46 href="../glib/glib-Basic-Types.html#gchar"
48 <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> length);</pre><p>
49 Truncate the file at <i class="parameter"><tt>text_uri</tt></i> to <i class="parameter"><tt>length</tt></i> bytes.</p><p>
51 </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 to be truncated
52 </td></tr><tr><td><span class="term"><i class="parameter"><tt>length</tt></i> :</span></td><td> length of the new file at <i class="parameter"><tt>text_uri</tt></i>
53 </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
54 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-truncate-uri"></a>gnome_vfs_truncate_uri ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_truncate_uri (GnomeVFSURI *uri,
55 <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> length);</pre><p>
56 Truncate the file at <i class="parameter"><tt>uri</tt></i> to be only <i class="parameter"><tt>length</tt></i> bytes. Data past <i class="parameter"><tt>length</tt></i>
57 bytes will be discarded.</p><p>
59 </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 to be truncated
60 </td></tr><tr><td><span class="term"><i class="parameter"><tt>length</tt></i> :</span></td><td> length of the new file at <i class="parameter"><tt>uri</tt></i>
61 </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
62 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-truncate-handle"></a>gnome_vfs_truncate_handle ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_truncate_handle (GnomeVFSHandle *handle,
63 <a href="gnome-vfs-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> length);</pre><p>
64 Truncate the file pointed to be <i class="parameter"><tt>handle</tt></i> to be only <i class="parameter"><tt>length</tt></i> bytes.
65 Data past <i class="parameter"><tt>length</tt></i> bytes will be discarded.</p><p>
67 </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> a handle to the file to be truncated
68 </td></tr><tr><td><span class="term"><i class="parameter"><tt>length</tt></i> :</span></td><td> length of the new file the handle is open to
69 </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
70 </td></tr></tbody></table></div></div></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-info-ops.html"><b><< Getting and Setting File Information</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-gnome-vfs-file-advanced-ops.html"><b>Advanced File Operations >></b></a></td></tr></table></body></html>