]> cloudbase.mooo.com Git - z180-stamp.git/blame - fatfs/documents/doc/write.html
Import fatfs R0.13b
[z180-stamp.git] / fatfs / documents / doc / write.html
CommitLineData
53668523
L
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
2<html lang="en">\r
3<head>\r
289f6a14 4<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
53668523
L
5<meta http-equiv="Content-Style-Type" content="text/css">\r
6<link rel="up" title="FatFs" href="../00index_e.html">\r
7<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/write.html">\r
8<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">\r
9<title>FatFs - f_write</title>\r
10</head>\r
11\r
12<body>\r
13\r
14<div class="para func">\r
15<h2>f_write</h2>\r
16<p>The f_write writes data to a file.</p>\r
17<pre>\r
18FRESULT f_write (\r
19 FIL* <span class="arg">fp</span>, <span class="c">/* [IN] Pointer to the file object structure */</span>\r
20 const void* <span class="arg">buff</span>, <span class="c">/* [IN] Pointer to the data to be written */</span>\r
21 UINT <span class="arg">btw</span>, <span class="c">/* [IN] Number of bytes to write */</span>\r
22 UINT* <span class="arg">bw</span> <span class="c">/* [OUT] Pointer to the variable to return number of bytes written */</span>\r
23);\r
24</pre>\r
25</div>\r
26\r
27<div class="para arg">\r
28<h4>Parameters</h4>\r
29<dl class="par">\r
30<dt>fp</dt>\r
31<dd>Pointer to the open file object structure.</dd>\r
32<dt>buff</dt>\r
33<dd>Pointer to the data to be written.</dd>\r
34<dt>btw</dt>\r
35<dd>Specifies number of bytes to write in range of <tt>UINT</tt> type.</dd>\r
36<dt>bw</dt>\r
289f6a14 37<dd>Pointer to the <tt>UINT</tt> variable to return the number of bytes written. This value is always valid after the function call regardless of the function return code.</dd>\r
53668523
L
38</dl>\r
39</div>\r
40\r
41\r
42<div class="para ret">\r
43<h4>Return Values</h4>\r
44<p>\r
45<a href="rc.html#ok">FR_OK</a>,\r
46<a href="rc.html#de">FR_DISK_ERR</a>,\r
47<a href="rc.html#ie">FR_INT_ERR</a>,\r
289f6a14 48<a href="rc.html#dn">FR_DENIED</a>,\r
53668523
L
49<a href="rc.html#io">FR_INVALID_OBJECT</a>,\r
50<a href="rc.html#tm">FR_TIMEOUT</a>\r
51</p>\r
52</div>\r
53\r
54\r
55<div class="para desc">\r
56<h4>Description</h4>\r
70702af1 57<p>The function starts to write data to the file at the position pointed by the read/write pointer. The read/write pointer advances as number of bytes written. After the function succeeded, <tt class="arg">*bw</tt> should be checked to detect the disk full. In case of <tt class="arg">*bw</tt> &lt; <tt class="arg">btw</tt>, it means the volume got full during the write operation. The function can take a time when the volume is full or close to full.</p>\r
53668523
L
58</div>\r
59\r
60\r
61<div class="para comp">\r
62<h4>QuickInfo</h4>\r
289f6a14 63<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt>.</p>\r
53668523
L
64</div>\r
65\r
66\r
67<div class="para ref">\r
68<h4>See Also</h4>\r
69<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">fputc</a>, <a href="puts.html">fputs</a>, <a href="printf.html">fprintf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>\r
70</div>\r
71\r
72<p class="foot"><a href="../00index_e.html">Return</a></p>\r
73</body>\r
74</html>\r