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=utf-8"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 8<title>NANDSimpleSafeClose</title> 9</head> 10 11<body> 12 13<h1>NANDSimpleSafeClose</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction">#include <revolution/nand.h> 17 18s32 NANDSimpleSafeClose(NANDFileInfo *info); 19</pre></dd></dl> 20 21<h2>Arguments</h2> 22<p> 23<TABLE class="arguments" border="1" > 24 <tr> 25<TH>info</TH> 26<TD>Pointer to the <CODE>NANDFileInfo</CODE> structure (opened by the <CODE>NANDSimpleSafeOpen[Async]</CODE> function).</TD> 27 </tr> 28</TABLE> 29</p> 30 31 32<h2>Return Values</h2> 33<p> 34Returns one of the following codes. 35</p> 36 37<p> 38<code>NAND_RESULT_OK<br> NAND_RESULT_ACCESS<br> NAND_RESULT_ALLOC_FAILED<br> NAND_RESULT_BUSY<br> NAND_RESULT_CORRUPT<br> NAND_RESULT_INVALID<br> NAND_RESULT_OPENFD<br> NAND_RESULT_UNKNOWN<br> NAND_RESULT_FATAL_ERROR<br></code> 39</p> 40 41<p> 42<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. 43</p> 44 45<h2>Description</h2> 46<p> 47Closes a file in a manner that guarantees the atomic nature of 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. 48</p> 49 50<p> 51This function sometimes puts the current thread to sleep, so it cannot be called from callback functions. For precautions when calling similar functions, refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>. 52</p> 53 54<p> 55This function updates the FAT of the Wii console NAND memory. 56</p> 57 58<h2>See Also</h2> 59<p class="reference"> 60<a href="./NANDSimpleSafeOpen.html">NANDSimpleSafeOpen</a><BR><a href="./NANDSimpleSafeOpenAsync.html">NANDSimpleSafeOpenAsync</a><BR><a href="./NANDSimpleSafeCloseAsync.html">NANDSimpleSafeCloseAsync</a><BR><a href="./NANDSimpleSafeCancel.html">NANDSimpleSafeCancel</a><BR><a href="./NANDSimpleSafeCancelAsync.html">NANDSimpleSafeCancelAsync</a><BR><a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 61</p> 62 63<h2>Revision History</h2> 64<p> 652008/04/23 Commented about updating the FAT.<br>2007/09/25 Added information about the sleep status of threads.<br>2007/05/09 Initial version.<BR> 66</p> 67 68<hr><p>CONFIDENTIAL</p></body> 69</html>