1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>NANDSafeCloseAsync</title>
9</head>
10
11<body>
12
13<h1>NANDSafeCloseAsync</h1>
14<p>
15<font color="ff0000">Use of this function is not recommended. If possible, consider using <CODE>NANDSimpleSafe</CODE>-related functions.</font>
16</p>
17
18<h2>Syntax</h2>
19<dl><dd><pre class="construction">
20#include &lt;revolution/nand.h&gt;
21
22typedef void (*NANDCallback)( s32 result, NANDCommandBlock *block );
23
24s32 NANDSafeCloseAsync( NANDFileInfo *info, NANDCallback cb, NANDCommandBlock *block );
25</pre></dd></dl>
26
27<h2>Arguments</h2>
28<p>
29<TABLE class="arguments" border="1" >
30  <tr>
31<TH>info</TH>
32<TD>(Pointer to the <CODE>NANDFileInfo</CODE> structure (opened by the <CODE>NANDSafeOpen[Async]</CODE> function)</TD>
33  </tr>
34  <tr>
35<TH>cb</TH>
36<TD>Callback function to call when this function completes processing.</TD>
37  </tr>
38  <tr>
39<TH>block</TH>
40<TD>Command block structure to be passed to the callback function.</TD>
41  </tr>
42</TABLE>
43</p>
44
45<h2>Return Values</h2>
46<p>
47The result codes that may be returned by <code>NANDSafeCloseAsync</code> are listed below. Returns <CODE>NAND_RESULT_OK</CODE> when the request begins normally.
48<p>
49<code>
50NAND_RESULT_OK<br>
51NAND_RESULT_ACCESS<br>
52NAND_RESULT_ALLOC_FAILED<br>
53NAND_RESULT_BUSY<br>
54NAND_RESULT_INVALID<br>
55NAND_RESULT_FATAL_ERROR<br>
56</code>
57</p>
58</p>
59<p>
60The result codes that may be passed to the callback function are listed below.
61</p>
62<p>
63<code>
64NAND_RESULT_OK<br>
65NAND_RESULT_ACCESS<br>
66NAND_RESULT_ALLOC_FAILED<br>
67NAND_RESULT_BUSY<br>
68NAND_RESULT_CORRUPT<br>
69NAND_RESULT_INVALID<br>
70NAND_RESULT_OPENFD<br>
71NAND_RESULT_UNKNOWN<br>
72NAND_RESULT_FATAL_ERROR<br>
73</code>
74</p>
75
76<p>
77<STRONG>Note:</STRONG> It is possible that this function may return <code>NAND_RESULT_OPENFD</code> because it performs deletion operations internally. However, <code>NAND_RESULT_OPENFD</code> will not be returned if the application does not perform an illegal operation, such as directly create files under the <code>/tmp/sys</code> directory used by <CODE>NANDSafe</CODE>-related functions.
78</p>
79
80<H2>Description</H2>
81<p>
82Asynchronously closes a file. Files closed using this function must have been opened using either the <code><a href="./NANDSafeOpen.html">NANDSafeOpen</a></code> function or the <code><a href="./NANDSafeOpenAsync.html">NANDSafeOpenAsync</a></code> function. Appropriate permissions (both read and write) must be set for the parent directory of the file where the <CODE>NANDSafe</CODE>-related function is applied. <code>NAND_RESULT_BUSY</code> is returned and this function call is denied when the queue for accepting requests inside the library is full.
83</p>
84<p>
85<font color="ff0000">Unlike a large number of asynchronous NAND functions, the callback specified with this function might receive <CODE>NAND_RESULT_ALLOC_FAILED</CODE> or <CODE>NAND_RESULT_BUSY</CODE> when <CODE>NAND_ACCESS_WRITE</CODE> or <CODE>NAND_ACCESS_RW</CODE> is specified for <CODE>accType</CODE> when opening a file.</font>
86</p>
87
88<p>
89This function updates the Wii console NAND memory's FAT.
90</p>
91
92<h2>See Also</h2>
93<p class="reference">
94<a href="./NANDSafeOpen.html">NANDSafeOpen</a>,
95<a href="./NANDSafeOpenAsync.html">NANDSafeOpenAsync</a>,
96<a href="./NANDSafeClose.html">NANDSafeClose</a>
97</p>
98
99<H2>Revision History</H2>
100<p>
1012008/07/29 Added information regarding the result code that the callback function might receive.<br>2008/05/13 Added description of the result codes passed to the callback function.<br>2008/04/23 Added mention of updating the FAT.<br>2007/05/09 Noted that the use of this function is not recommended.<br>2007/02/xx Added a note for the <CODE>NAND_RESULT_OPENFD</CODE> result code.<br>2006/09/19 Added information regarding the result code that the callback function may receive.<br>2006/09/08 Added a requirement for the parent directory permissions.<br>2006/08/30 Added the <CODE>NAND_RESULT_OPENFD</CODE> result code.<br>2006/08/15 Initial version.<BR>
102</p>
103
104<hr><p>CONFIDENTIAL</p></body>
105</html>
106