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>NANDOpen</title> 9</head> 10 11<body> 12 13<h1>NANDOpen</h1> 14 15<h2>C Specification</h2> 16<dl><dd><pre><code> 17#include <revolution/nand.h> 18 19#define NAND_ACCESS_READ 0x01 20#define NAND_ACCESS_WRITE 0x02 21#define NAND_ACCESS_RW (NAND_ACCESS_READ | NAND_ACCESS_WRITE) 22 23s32 NANDOpen(const char *path, NANDFileInfo *info, u8 accType); 24</code></pre></dd></dl> 25 26<h2>Arguments</h2> 27<p> 28<TABLE border="1" > 29 <tr> 30<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><code><EM><STRONG>path</STRONG></EM></code></EM></STRONG></CODE></TD> 31<TD width="520">File name to open.</TD> 32 </tr> 33 <tr> 34<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>info</EM></STRONG></CODE></TD> 35<TD width="520">Pointer to a <CODE>NANDFileInfo</CODE> structure.</TD> 36 </tr> 37 <tr> 38<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>accType</EM></STRONG></CODE></TD> 39<TD width="520">Access type. Specifies either <code>NAND_ACCESS_READ</code>, <code>NAND_ACCESS_WRITE</code>, or <CODE>NAND_ACCESS_RW</CODE>.</TD> 40 </tr> 41</TABLE> 42</p> 43 44 45<h2>Return Values</h2> 46<p> 47Returns one of the following codes: 48<p> 49<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> 50</p> 51</p> 52 53<H2>Description</H2> 54<p> 55Opens 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. 56</p> 57 58<p> 59This 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>. 60</p> 61 62<h2>See Also</h2> 63<p> 64<code><a href="./NANDOpenAsync.html">NANDOpenAsync</a></code>, <code><a href="./NANDClose.html">NANDClose</a></code>, <code><a href="./NANDCloseAsync.html">NANDCloseAsync</a></code>, <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 65</p> 66 67<H2>Revision History</H2> 68<p> 692007/09/25 Added information on the sleep status of threads.<br>2006/11/30 Added <CODE>NAND_RESULT_ALLOC_FAILED</CODE> and <CODE>NAND_RESULT_BUSY</CODE> codes.<br>2006/06/16 Initial version.<br> 70</p> 71 72 73<hr><p>CONFIDENTIAL</p></body> 74</html> 75