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 the NANDSimpleSafe version of this function.</font> 16</p> 17 18<h2>C Specification</h2> 19<dl><dd><pre><code> 20#include <revolution/nand.h> 21 22s32 NANDSafeClose(NANDFileInfo *info); 23</code></pre></dd></dl> 24 25<h2>Arguments</h2> 26<p> 27<TABLE border="1" > 28 <tr> 29<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>info</EM></STRONG></CODE></TD> 30<TD width="520">Pointer to the <CODE>NANDFileInfo</CODE> structure (opened by <CODE>NANDSafeOpen[Async]</CODE>).</TD> 31 </tr> 32</TABLE> 33</p> 34 35 36<h2>Return Values</h2> 37<p> 38Returns one of the following codes: 39</p> 40 41<p> 42<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> 43</p> 44 45<p> 46<strong>Note:</strong> Because this function performs delete operations internally, it may potentially return <code>NAND_RESULT_OPENFD</code>. Nevertheless, <code>NAND_RESULT_OPENFD</code> is not returned as long as there are no illegal operations, such as the application program attempting to directly create a file below the <code>/tmp/sys</code> directory used by the NANDSafe functions. 47</p> 48 49<H2>Description</H2> 50<p> 51Closes a file. Files closed with this function must have been opened using <code><a href="./NANDSafeOpen.html">NANDSafeOpen</a></code> or <code><a href="./NANDSafeOpenAsync.html">NANDSafeOpenAsync</a></code>. Appropriate permissions (both read and write) must be set for the parent directory of the file where the NANDSafe type of function is applied. 52</p> 53 54<p> 55This 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>. 56</p> 57 58<h2>See Also</h2> 59<p> 60<code><a href="./NANDSafeOpen.html">NANDSafeOpen</a></code>, <code><a href="./NANDSafeOpenAsync.html">NANDSafeOpenAsync</a></code>, <code><a href="./NANDSafeCloseAsync.html">NANDSafeCloseAsync</a></code>, <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 61</p> 62 63<H2>Revision History</H2> 64<p> 652007/09/25 Added information on 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 result code <CODE>NAND_RESULT_MAXDEPTH</CODE>.<br>2006/11/30 Added <CODE>NAND_RESULT_ALLOC_FAILED</CODE> and <CODE>NAND_RESULT_BUSY</CODE> codes.<br>2006/9/8 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> 66</p> 67 68<hr><p>CONFIDENTIAL</p></body> 69</html> 70