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>NANDSimpleSafeCloseAsync</title> 9</head> 10 11<body> 12 13<h1>NANDSimpleSafeCloseAsync</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction"> 17#include <revolution/nand.h> 18 19typedef void (*NANDCallback)( s32 result, NANDCommandBlock *block ); 20 21s32 NANDSimpleSafeCloseAsync(NANDFileInfo *info, NANDCallback cb, NANDCommandBlock *block); 22</pre></dd></dl> 23 24<h2>Arguments</h2> 25<p> 26<TABLE class="arguments" border="1" > 27 <tr> 28<TH>info</TH> 29<TD>(Pointer to the <CODE>NANDFileInfo</CODE> structure (opened by the <CODE>NANDSimpleSafeOpen[Async]</CODE> function).</TD> 30 </tr> 31 <tr> 32<TH>cb</TH> 33<TD>Callback function to call when this function completes processing.</TD> 34 </tr> 35 <tr> 36<TH>block</TH> 37<TD>Command block structure to be passed to the callback function.</TD> 38 </tr> 39</TABLE> 40</p> 41 42<h2>Return Values</h2> 43<p> 44The result codes that <code>NANDSimpleSafeCloseAsync</code> can return are listed below. When the request begins normally, returns <CODE>NAND_RESULT_OK</CODE>. 45<p> 46<code> 47NAND_RESULT_OK<br> 48NAND_RESULT_ACCESS<br> 49NAND_RESULT_ALLOC_FAILED<br> 50NAND_RESULT_BUSY<br> 51NAND_RESULT_INVALID<br> 52NAND_RESULT_FATAL_ERROR<br> 53</code> 54</p> 55</p> 56<p> 57The result codes that may be passed to the callback function are listed below. 58</p> 59<p> 60<code> 61NAND_RESULT_OK<br> 62NAND_RESULT_ACCESS<br> 63NAND_RESULT_ALLOC_FAILED<br> 64NAND_RESULT_BUSY<br> 65NAND_RESULT_CORRUPT<br> 66NAND_RESULT_INVALID<br> 67NAND_RESULT_OPENFD<br> 68NAND_RESULT_UNKNOWN<br> 69NAND_RESULT_FATAL_ERROR<br> 70</code> 71</p> 72 73<p> 74<STRONG>Note:</STRONG> It is possible that this function may return <code>NAND_RESULT_OPENFD</code> due to internal operations. However, <code>NAND_RESULT_OPENFD</code> will not be returned if the application does not perform an illegal operation, such as directly access files under the <code>/tmp/sys</code> directory used by <CODE>NANDSimpleSafe</CODE>-related functions. 75</p> 76 77<h2>Description</h2> 78<p> 79Asynchronously closes a file in a manner that guarantees the atomic nature of the file updates. Files closed using this function must have been opened using either the <code><a href="./NANDSimpleSafeOpen.html">NANDSimpleSafeOpen</a></code> or <code><a href="./NANDSimpleSafeOpenAsync.html">NANDSimpleSafeOpenAsync</a></code> function. Appropriate permissions (both read and write) must be set for the parent directory of the file to which <CODE>NANDSimpleSafe</CODE>-related functions are applied. 80</p> 81<p> 82<font color="ff0000">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> 83</p> 84 85<p> 86This function updates the FAT of the Wii console NAND memory. 87</p> 88 89<h2>See Also</h2> 90<p class="reference"> 91<a href="./NANDSimpleSafeOpen.html">NANDSimpleSafeOpen</a>, 92<a href="./NANDSimpleSafeOpenAsync.html">NANDSimpleSafeOpenAsync</a>, 93<a href="./NANDSimpleSafeClose.html">NANDSimpleSafeClose</a>, 94<a href="./NANDSimpleSafeCancel.html">NANDSimpleSafeCancel</a>, 95<a href="./NANDSimpleSafeCancelAsync.html">NANDSimpleSafeCancelAsync</a> 96</p> 97 98<h2>Revision History</h2> 99<p> 1002008/07/29 Added information regarding the result code that the callback function might receive.<br>2008/05/13 Described the result codes passed to the callback function.<br>2008/04/23 Commented about updating the FAT.<br>2007/05/09 Initial version.<BR> 101</p> 102 103<hr><p>CONFIDENTIAL</p></body> 104</html> 105