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>NANDSafeClose</title>
9</head>
10
11<body>
12
13<h1>NANDSafeClose</h1>
14<p>
15<font color="ff0000">We do not recommend the use of this function. If possible, consider using <CODE>NANDSimpleSafe</CODE>-related functions.</font>
16</p>
17
18<h2>Syntax</h2>
19<dl><dd><pre class="construction">#include &lt;revolution/nand.h&gt;
20
21s32 NANDSafeClose(NANDFileInfo *info);
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>NANDSafeOpen[Async]</CODE> function)</TD>
30  </tr>
31</TABLE>
32</p>
33
34<h2>Return Values</h2>
35<p>
36Returns one of the following codes.
37</p>
38
39<p>
40<code>
41NAND_RESULT_OK<br>
42NAND_RESULT_ACCESS<br>
43NAND_RESULT_ALLOC_FAILED<br>
44NAND_RESULT_BUSY<br>
45NAND_RESULT_CORRUPT<br>
46NAND_RESULT_INVALID<br>
47NAND_RESULT_OPENFD<br>
48NAND_RESULT_UNKNOWN<br>
49NAND_RESULT_FATAL_ERROR<br>
50</code>
51</p>
52
53<p>
54<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.
55</p>
56
57<H2>Description</H2>
58<p>
59Closes a file. Files closed using this function must have been opened using either the <code><a href="./NANDSafeOpen.html">NANDSafeOpen</a></code> or <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 to which <CODE>NANDSafe</CODE>-related functions are applied.
60</p>
61
62<p>
63This 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>.
64</p>
65
66<p>
67This function updates the FAT of the Wii console NAND memory.
68</p>
69
70<h2>See Also</h2>
71<p class="reference">
72<a href="./NANDSafeOpen.html">NANDSafeOpen</a>,
73<a href="./NANDSafeOpenAsync.html">NANDSafeOpenAsync</a>,
74<a href="./NANDSafeCloseAsync.html">NANDSafeCloseAsync</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 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/11/30 Added the <CODE>NAND_RESULT_ALLOC_FAILED</CODE> and <CODE>NAND_RESULT_BUSY</CODE> codes.<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>
81</p>
82
83<hr><p>CONFIDENTIAL</p></body>
84</html>