FIL* <spanclass="arg">fp</span>, <spanclass="c">/* [IN] Pointer to the file object structure */</span>
const void* <spanclass="arg">buff</span>, <spanclass="c">/* [IN] Pointer to the data to be written */</span>
UINT <spanclass="arg">btw</span>, <spanclass="c">/* [IN] Number of bytes to write */</span>
UINT* <spanclass="arg">bw</span><spanclass="c">/* [OUT] Pointer to the variable to return number of bytes written */</span>
);
</pre>
</div>
<divclass="para arg">
<h4>Parameters</h4>
<dlclass="par">
<dt>fp</dt>
<dd>Pointer to the open file object structure.</dd>
<dt>buff</dt>
<dd>Pointer to the data to be written.</dd>
<dt>btw</dt>
<dd>Specifies number of bytes to write in range of <tt>UINT</tt> type.</dd>
<dt>bw</dt>
<dd>Pointer to the <tt>UINT</tt> variable to return the number of bytes written. The value is always valid after the function call regardless of the result.</dd>
</dl>
</div>
<divclass="para ret">
<h4>Return Values</h4>
<p>
<ahref="rc.html#ok">FR_OK</a>,
<ahref="rc.html#de">FR_DISK_ERR</a>,
<ahref="rc.html#ie">FR_INT_ERR</a>,
<ahref="rc.html#nr">FR_NOT_READY</a>,
<ahref="rc.html#io">FR_INVALID_OBJECT</a>,
<ahref="rc.html#tm">FR_TIMEOUT</a>
</p>
</div>
<divclass="para desc">
<h4>Description</h4>
<p>The read/write pointer of the file object advances number of bytes written. After the function succeeded, <ttclass="arg">*bw</tt> should be checked to detect the disk full. In case of <ttclass="arg">*bw</tt> is less than <ttclass="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>