1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
6 <link rel=
"up" title=
"FatFs" href=
"../00index_e.html">
7 <link rel=
"alternate" hreflang=
"ja" title=
"Japanese" href=
"../ja/truncate.html">
8 <link rel=
"stylesheet" href=
"../css_e.css" type=
"text/css" media=
"screen" title=
"ELM Default">
9 <title>FatFs - f_truncate
</title>
14 <div class=
"para func">
16 <p>The f_truncate function truncates the file size.
</p>
19 FIL*
<span class=
"arg">fp
</span> <span class=
"c">/* [IN] File object */
</span>
24 <div class=
"para arg">
28 <dd>Pointer to the open file object to be truncated.
</dd>
33 <div class=
"para ret">
34 <h4>Return Values
</h4>
36 <a href=
"rc.html#ok">FR_OK
</a>,
37 <a href=
"rc.html#de">FR_DISK_ERR
</a>,
38 <a href=
"rc.html#ie">FR_INT_ERR
</a>,
39 <a href=
"rc.html#dn">FR_DENIED
</a>,
40 <a href=
"rc.html#io">FR_INVALID_OBJECT
</a>,
41 <a href=
"rc.html#tm">FR_TIMEOUT
</a>
46 <div class=
"para desc">
48 <p>The
<tt>f_truncate
</tt> function truncates the file size to the current file read/write pointer. This function has no effect if the file read/write pointer is already pointing end of the file.
</p>
52 <div class=
"para comp">
54 <p>Available when
<tt><a href=
"config.html#fs_readonly">FF_FS_READONLY
</a> ==
0</tt> and
<tt><a href=
"config.html#fs_minimize">FF_FS_MINIMIZE
</a> ==
0</tt>.
</p>
58 <div class=
"para ref">
60 <p><tt><a href=
"open.html">f_open
</a>,
<a href=
"lseek.html">f_lseek
</a>,
<a href=
"sfile.html">FIL
</a></tt></p>
64 <p class=
"foot"><a href=
"../00index_e.html">Return
</a></p>