FreeRTOS
[armadillo_firmware.git] / FreeRTOS / Common / FileSystem / FatFs-0.7e / doc / en / truncate.html
blobcb6f0b0441ea0d1e50eb103ebcef6d56c23c5e61
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <link rel="up" title="FatFs" href="../00index_e.html">
7 <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
8 <title>FatFs - f_truncate</title>
9 </head>
11 <body>
13 <div class="para">
14 <h2>f_truncate</h2>
15 <p>The f_truncate function truncates the file size.</p>
16 <pre>
17 FRESULT f_truncate (
18 FIL* <em>FileObject</em> /* Pointer to the file object */
20 </pre>
21 </div>
23 <div class="para">
24 <h4>Parameter</h4>
25 <dl class="par">
26 <dt>FileObject</dt>
27 <dd>Pointer to the open file object to be truncated.</dd>
28 </dl>
29 </div>
32 <div class="para">
33 <h4>Return Values</h4>
34 <dl class="ret">
35 <dt>FR_OK (0)</dt>
36 <dd>The function succeeded.</dd>
37 <dt>FR_DENIED</dt>
38 <dd>The file has been opened in read-only mode.</dd>
39 <dt>FR_DISK_ERR</dt>
40 <dd>The function failed due to an error in the disk function.</dd>
41 <dt>FR_INT_ERR</dt>
42 <dd>The function failed due to a wrong FAT structure or an internal error.</dd>
43 <dt>FR_NOT_READY</dt>
44 <dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
45 <dt>FR_INVALID_OBJECT</dt>
46 <dd>The file object is invalid.</dd>
47 </dl>
48 </div>
51 <div class="para">
52 <h4>Description</h4>
53 <p>The f_truncate function truncates the file size to the current file R/W point. When the file R/W pointer is already pointing end of the file, this function has no effect.</p>
54 </div>
57 <div class="para">
58 <h4>QuickInfo</h4>
59 <p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
60 </div>
63 <div class="para">
64 <h4>See Also</h4>
65 <p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
66 </div>
69 <p class="foot"><a href="../00index_e.html">Return</a></p>
70 </body>
71 </html>