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>NANDOpen</title> 9</head> 10 11<body> 12 13<h1>NANDOpen</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction">#include <revolution/nand.h> 17 18#define NAND_ACCESS_READ 0x01 19#define NAND_ACCESS_WRITE 0x02 20#define NAND_ACCESS_RW (NAND_ACCESS_READ | NAND_ACCESS_WRITE) 21 22s32 NANDOpen(const char *path, NANDFileInfo *info, u8 accType); 23</pre></dd></dl> 24 25<h2>Arguments</h2> 26<p> 27<TABLE class="arguments" border="1" > 28 <tr> 29<TH>path</TH> 30<TD>Name of the file to open.</TD> 31 </tr> 32 <tr> 33<TH>info</TH> 34<TD>Pointer to a <CODE>NANDFileInfo</CODE> structure.</TD> 35 </tr> 36 <tr> 37<TH>accType</TH> 38<TD>Access type. Specifies either <code>NAND_ACCESS_READ</code>, <code>NAND_ACCESS_WRITE</code> or <CODE>NAND_ACCESS_RW</CODE>.</TD> 39 </tr> 40</TABLE> 41</p> 42 43<h2>Return Values</h2> 44<p> 45Returns one of the following codes. 46<p> 47<code>NAND_RESULT_OK<br> NAND_RESULT_ACCESS<br> NAND_RESULT_ALLOC_FAILED<br> NAND_RESULT_BUSY<br> NAND_RESULT_INVALID<br> NAND_RESULT_MAXFD<br> NAND_RESULT_NOEXISTS<br> NAND_RESULT_UNKNOWN<br> NAND_RESULT_FATAL_ERROR<br></code> 48</p> 49</p> 50 51<H2>Description</H2> 52<p> 53Opens a file. Proper access rights are required to open a file. You can't open files if you don't have permission to access those files. 54</p> 55 56<p> 57This function sometimes puts the current thread to sleep, so it cannot be called from callback functions. For precautions related to calling similar functions, see <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>. 58</p> 59 60<h2>See Also</h2> 61<p class="reference"> 62<a href="./NANDOpenAsync.html">NANDOpenAsync</a><BR><a href="./NANDClose.html">NANDClose</a><BR><a href="./NANDCloseAsync.html">NANDCloseAsync</a><BR><a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 63</p> 64 65<H2>Revision History</H2> 66<p> 672007/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/06/16 Initial version.<br> 68</p> 69 70<hr><p>CONFIDENTIAL</p></body> 71</html>