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 <nitro/fs.h> 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.</p> 42<p> 43If the specified size exceeds the end of the file, the size is automatically increased for the SD memory card archive and NAND archive.<br />For other standard archives, writes to the end and returns that size without increasing the size. 44</p> 45 46<h2>Note</h2> 47<ul style="color:Red"> 48<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> 49<li>In some cases, processing may not end if interrupts are left prohibited.</li> 50</ul> 51 52<h2>See Also</h2> 53<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> 54 55<h2>Revision History</h2> 56<p> 572010/01/14 Revised the archives whose size can be increased automatically.<br />2009/12/11Revised the archives whose size can be increased automatically.<br /><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. 58</p> 59 60<hr><p>CONFIDENTIAL</p></body> 61</html> 62