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>NANDCreateDir</title>
9</head>
10
11<body>
12
13<h1>NANDCreateDir</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">#include &lt;revolution/nand.h&gt;
17
18#define NAND_PERM_OTHER_READ   0x01
19#define NAND_PERM_OTHER_WRITE  0x02
20#define NAND_PERM_GROUP_READ   0x04
21#define NAND_PERM_GROUP_WRITE  0x08
22#define NAND_PERM_OWNER_READ   0x10
23#define NAND_PERM_OWNER_WRITE  0x20
24
25s32 NANDCreateDir( const char *path, u8 perm, u8 attr );
26</pre></dd></dl>
27
28<h2>Arguments</h2>
29<p>
30<TABLE class="arguments" border="1" >
31  <tr>
32<TH>path</TH>
33<TD>Specifies the directory name.</TD>
34  </tr>
35  <tr>
36<TH>perm</TH>
37<TD>Directory permissions. Specify by taking the logical sum of <code>NAND_PERM_*</code>.</TD>
38  </tr>
39  <tr>
40<TH>attr</TH>
41<TD>Specifies the directory attributes.</TD>
42  </tr>
43</TABLE>
44</p>
45
46<h2>Return Values</h2>
47<p>
48Returns one of the following codes.
49<p>
50<code>
51NAND_RESULT_OK<br>
52NAND_RESULT_ACCESS<br>
53NAND_RESULT_ALLOC_FAILED<br>
54NAND_RESULT_BUSY<br>
55NAND_RESULT_CORRUPT<br>
56NAND_RESULT_EXISTS<br>
57NAND_RESULT_INVALID<br>
58NAND_RESULT_MAXDEPTH<br>
59NAND_RESULT_MAXFILES<br>
60NAND_RESULT_NOEXISTS<br>
61NAND_RESULT_UNKNOWN<br>
62NAND_RESULT_FATAL_ERROR<br>
63</code>
64</p>
65</p>
66
67<H2>Description</H2>
68<p>
69Creates a new directory. The specified permissions and attributes are given to the directory. <font color="#ff0000">The directory must be granted at least the <CODE>NAND_PERM_OWNER_READ</CODE> permission.</font>If the <CODE>NAND_PERM_OWNER_READ</CODE> permission is not granted, the function will return <CODE>NAND_RESULT_INVALID</CODE>.
70</p>
71
72<p>
73This function may put the current thread to sleep. For precautions related to calling similar functions, see <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.
74</p>
75
76<p>
77This function updates the FAT of the Wii console NAND memory.
78</p>
79
80<h2>See Also</h2>
81<p class="reference">
82<a href="./NANDCreateDirAsync.html">NANDCreateDirAsync</a>,
83<a href="./NANDDelete.html">NANDDelete</a>,
84<a href="./NANDDeleteAsync.html">NANDDeleteAsync</a>,
85<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>
86</p>
87
88<H2>Revision History</H2>
89<p>
902008/04/23 Commented about updating the FAT.<br>2007/09/25 Added information about the sleep status of threads.<br>2007/02/xx Added the <CODE>NAND_RESULT_MAXDEPTH</CODE> result code.<br>2006/11/30 Added the <CODE>NAND_RESULT_ALLOC_FAILED</CODE> and <CODE>NAND_RESULT_BUSY</CODE> codes.<br>2006/11/13 Added an explanation about the need to grant <CODE>NAND_PERM_OWNER_READ</CODE> permission.<br>2006/08/30 Added the <CODE>NAND_RESULT_NOEXISTS</CODE> result code.<br>2006/06/16 Initial version.<BR>
91</p>
92
93<hr><p>CONFIDENTIAL</p></body>
94</html>