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>NANDCountNumOpenableFiles</title>
9</head>
10
11<body>
12
13<h1>NANDCountNumOpenableFiles</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">#include &lt;revolution/nand.h&gt;
17
18s32 NANDCountNumOpenableFiles( u8 *number, BOOL *cleaning );
19</pre></dd></dl>
20
21<h2>Arguments</h2>
22<p>
23<TABLE class="arguments" border="1" >
24  <tr>
25    <TH>number</TH>
26    <TD>The number of files that can be opened.</TD>
27  </tr>
28  <tr>
29    <TH>cleaning</TH>
30    <TD>The result of deleting files used for counting by internal processes. If successful, <code>TRUE</code> is stored.  If the process fails, <code>FALSE</code> is stored.</TD>
31  </tr>
32</TABLE>
33</p>
34
35<h2>Return Values</h2>
36<p>
37Returns one of the following codes.
38<p>
39<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>
40</p>
41</p>
42
43<H2>Description</H2>
44<p>
45Gets the number of files that can be opened. If the return value is anything other than <code>NAND_RESULT_OK</code>, the processing of count-use files has failed. When that occurs, the value stored in <code>number</code> (the number of files that can be opened) might not be correct. <br><br>
46
47If <code>cleaning</code> is <code>FALSE</code>, the deletion of the count-use files under <code>/tmp</code> has failed. Even after the process ends there might be as many as 16 inodes being consumed under <code>/tmp</code>. When the application reboots, the system automatically deletes the count-use files. Because the files are created under <code>/tmp/count_tmpdir</code>, the application can also delete these files. However, this function is for debugging purposes, so you do not need to perform error processing.<br><br>
48
49<font color="red"><b>Because this function is used for debugging applications, it works only with the debug version library. It does not work with the release version library, where <CODE>NAND_RESULT_FATAL_ERROR</CODE> is always the return value.</b></font>The purpose of this function is to troubleshoot why <code>NAND_RESULT_MAXFD</code> is returned when the <code>NAND</code> application has several content files, system files, and middleware files open (including some the developer may be unaware of). This refers to  files opened by the system and by middleware.
50</p>
51
52<p>
53This function sometimes puts the current thread to sleep, so it cannot be called from callback functions. For precautions when calling similar functions, see <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.
54</p>
55
56<h2>See Also</h2>
57<p class="reference">
58<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>
59</p>
60
61<H2>Revision History</H2>
62<p>
632009/07/22 Initial version.
64</p>
65
66<hr><p>CONFIDENTIAL</p></body>
67</html>