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>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> 39NAND_RESULT_OK<br> 40NAND_RESULT_ACCESS<br> 41NAND_RESULT_ALLOC_FAILED<br> 42NAND_RESULT_BUSY<br> 43NAND_RESULT_CORRUPT<br> 44NAND_RESULT_INVALID<br> 45NAND_RESULT_OPENFD<br> 46NAND_RESULT_UNKNOWN<br> 47NAND_RESULT_FATAL_ERROR<br> 48</code> 49</p> 50 51<p> 52<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. 53</p> 54 55<h2>Description</h2> 56<p> 57Closes 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. 58</p> 59 60<p> 61This function may put the current thread to sleep. For precautions when calling similar functions, refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>. 62</p> 63 64<p> 65This function updates the FAT of the Wii console NAND memory. 66</p> 67 68<h2>See Also</h2> 69<p class="reference"> 70<a href="./NANDSimpleSafeOpen.html">NANDSimpleSafeOpen</a>, 71<a href="./NANDSimpleSafeOpenAsync.html">NANDSimpleSafeOpenAsync</a>, 72<a href="./NANDSimpleSafeCloseAsync.html">NANDSimpleSafeCloseAsync</a>, 73<a href="./NANDSimpleSafeCancel.html">NANDSimpleSafeCancel</a>, 74<a href="./NANDSimpleSafeCancelAsync.html">NANDSimpleSafeCancelAsync</a>, 75<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 76</p> 77 78<h2>Revision History</h2> 79<p> 802008/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> 81</p> 82 83<hr><p>CONFIDENTIAL</p></body> 84</html>