1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>FS_ReadFileAsync</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">FS_ReadFileAsync <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14<DD><CODE>#include &lt;nitro/fs.h&gt;</CODE><BR> <BR> <CODE>s32 FS_ReadFileAsync( <A href="../fs_file_type.html">FSFile</a> *p_file, void *dst, s32 len );</CODE><BR>
15</DL>
16<H2>Arguments</H2>
17<TABLE border="1" width="100%">
18  <TBODY>
19    <TR>
20<TD width="13%"><EM><STRONG>p_file</STRONG></EM></TD>
21<TD width="87%">Address of the <A href="../fs_file_type.html"><CODE>FSFile</CODE></A> structure.</TD>
22    </TR>
23    <TR>
24<TD width="13%"><EM><STRONG>dst</STRONG></EM></TD>
25<TD width="87%">Address of the storage destination buffer.</TD>
26    </TR>
27    <TR>
28<TD width="13%"><EM><STRONG>len</STRONG></EM></TD>
29<TD width="87%">Length of data being read, in bytes.</TD>
30    </TR>
31  </TBODY>
32</TABLE>
33<H2>Return Values</H2>
34<P> If the data is read correctly, it returns the number of bytes. Otherwise, it returns -1.</P>
35<H2>Description</H2>
36<P>
37This function asynchronously reads a specified amount of data from current position of the file pointer. If the specified amount of data extends beyond the end of the file, the function reads to the end of the file and returns that as the size.<br><br> Unlike <code><a href="FS_WriteFile.html">FS_ReadFile()</a></code>, this function returns control immediately and starts asynchronous execution.<br> To confirm process completion, periodically check the return value with the <A href="FS_IsBusy.html"><code>FS_IsBusy</code></A> function, or set the thread to wait status with the <A href="FS_WaitAsync.html"><code>FS_WaitAsync</code></A> function. If you are using the <A href="../archive_rom_spec.html"><code>ROM archive</code></A> to read Game Card data, also see the description for the <a href="../../card/rom/CARD_ReadRomAsync.html"><code>CARD_ReadRomAsync</code></a> function. <br>
38</P>
39<H2>Note</H2>
40<P><FONT color="#800000">If the archive cannot run the process asynchronously, this function becomes a synchronous process, just like <a href="FS_ReadFile.html"><code>FS_ReadFile</code></a>. This function cannot be called from the interrupt handler (IRQ mode). The process may not be completed if interrupts are prohibited.</FONT></P>
41<H2>See Also</H2>
42<P><CODE><A href="../fs_file_type.html">FSFile</A><BR> <A href="FS_ReadFile.html">FS_ReadFile</A><BR> <A href="FS_WaitAsync.html">FS_WaitAsync</A><BR> <A href="FS_GetFileLength.html">FS_GetFileLength</A><BR> <A href="FS_GetFilePosition.html">FS_GetFilePosition</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>
43<H2>Revision History</H2>
44<P>
452008/10/02 Updated the access list.<br>2005/08/28 Added link to the <CODE>CARD_ReadRomAsync</CODE> function in the Description section.<br>2004/09/24 Added the description in the Caution section regarding the conditions for calling this function.<br>2004/07/13 Revised description to that of the general archive.<br>2004/05/14 Initial version.
46</P>
47<hr><p>CONFIDENTIAL</p></body>
48</HTML>
49