1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5<meta http-equiv="Content-Style-Type" content="text/css" />
6<title>FS_WriteFile</title>
7<link rel="stylesheet" href="../../css/nitro.css" type="text/css" />
8</head>
9
10<body>
11
12<h1>FS_WriteFile <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></h1>
13<h2>Syntax</h2>
14<pre><code>
15#include &lt;nitro/fs.h&gt;
16s32	FS_WriteFile(<A href="../fs_file_type.html">FSFile</a>* p_file, const void *src, s32 len);
17</code></pre>
18
19<h2>Arguments</h2>
20<table style="width:100%">
21<tbody>
22<tr>
23<td style="width:13%"><em><strong>file</strong></em></td>
24<td style="width:87%"><A href="../fs_file_type.html">FSFile</a> structure that indicates an opened file.</td>
25</tr>
26<tr>
27<td style="width:13%"><em><strong>src</strong></em></td>
28<td style="width:87%">Transfer source buffer<br />There is no need to store the cache in advance.</td>
29</tr>
30<tr>
31<td style="width:13%"><em><strong>len</strong></em></td>
32<td style="width:87%">Byte length of data to be written.</td>
33</tr>
34</tbody>
35</table>
36
37<h2>Return Values</h2>
38<p>Returns the number of bytes if the data was written properly. If not, returns <code>-1</code>.</p>
39
40<h2>Description</h2>
41<p>This function writes data of the specified size beginning at the current location of the file pointer.<br />When the specified size is greater than the available memory, data is written until the available memory is used up. The size of the written data is returned. The standard archives whose size can be increased automatically are the SD memory card archive and the NAND archive for NAND applications.<br />The size cannot be increased automatically for standard archives other than these.</p>
42
43<h2>Note</h2>
44<ul style="color:Red">
45<li>This function puts the thread to sleep to wait for the process to complete. As a result, it cannot be called from the interrupt handler (IRQ mode).</li>
46<li>In some cases, processing may not end if interrupts are left prohibited.</li>
47</ul>
48
49<h2>See Also</h2>
50<p><code> <a href="FS_CloseFile.html">FS_CloseFile</a><BR> <a href="../fs_file_type.html">FSFile</a><BR><a href="FS_GetFileLength.html">FS_GetFileLength</a><BR> <a href="FS_OpenFileEx.html">FS_OpenFileEx</a><BR> <a href="FS_OpenFileFast.html">FS_OpenFileFast</a><BR> <a href="FS_SeekFile.html">FS_SeekFile</a><BR> <a href="FS_SeekFileToBegin.html">FS_SeekFileToBegin</a><BR> <a href="FS_SeekFileToEnd.html">FS_SeekFileToEnd</a></code></p>
51
52<h2>Revision History</h2>
53<p>
542009/12/11 Revised the archives whose size can be increased automatically.<br />2009/12/01 Clarified which archives can be automatically increased in size.<br />2008/10/02 Updated part of the <B>See Also</B> list.<br />2008/02/27 Explained that cache storage of write data is unnecessary.<br />2004/09/24 Added the description in the Caution section regarding the conditions for calling this function.<br /> 2004/07/13 Initial version.
55</p>
56
57<hr><p>CONFIDENTIAL</p></body>
58</html>
59