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>NANDCreate</title>
9</head>
10
11<body>
12
13<h1>NANDCreate</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 NANDCreate(const char *filename, 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>filename</TH>
33<TD>Specifies the file name.</TD>
34  </tr>
35  <tr>
36<TH>perm</TH>
37<TD>File 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 file 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_MAXFILES<br>
59NAND_RESULT_NOEXISTS<br>
60NAND_RESULT_UNKNOWN<br>
61NAND_RESULT_FATAL_ERROR<br>
62</code>
63</p>
64</p>
65
66<H2>Description</H2>
67<p>
68Creates a new file. The specified permissions and attributes are given to the file. <font color="#ff0000">However, the file must be granted at least the <CODE>NAND_PERM_OWNER_READ</CODE> permission.</font><CODE></font> If the <CODE>NAND_PERM_OWNER_READ</CODE> permission is not granted, the function will return <CODE>NAND_RESULT_INVALID</CODE>.
69</p>
70
71<p>
72This 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>.
73</p>
74
75<p>
76This function updates the FAT of the Wii console NAND memory.
77</p>
78
79<h2>See Also</h2>
80<p class="reference">
81<a href="./NANDCreateAsync.html">NANDCreateAsync</a>,
82<a href="./NANDDelete.html">NANDDelete</a>,
83<a href="./NANDDeleteAsync.html">NANDDeleteAsync</a>,
84<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>
85</p>
86
87<H2>Revision History</H2>
88<p>
892008/04/23 Commented about updating the FAT.<br>2007/09/25 Added information about the sleep status of threads.<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>
90</p>
91
92<hr><p>CONFIDENTIAL</p></body>
93</html>