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>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> 48NAND_RESULT_OK<br> 49NAND_RESULT_ACCESS<br> 50NAND_RESULT_ALLOC_FAILED<br> 51NAND_RESULT_BUSY<br> 52NAND_RESULT_INVALID<br> 53NAND_RESULT_MAXFD<br> 54NAND_RESULT_NOEXISTS<br> 55NAND_RESULT_UNKNOWN<br> 56NAND_RESULT_FATAL_ERROR<br> 57</code> 58</p> 59</p> 60 61<H2>Description</H2> 62<p> 63Opens 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. 64</p> 65 66<p> 67This 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>. 68</p> 69 70<h2>See Also</h2> 71<p class="reference"> 72<a href="./NANDOpenAsync.html">NANDOpenAsync</a>, 73<a href="./NANDClose.html">NANDClose</a>, 74<a href="./NANDCloseAsync.html">NANDCloseAsync</a>, 75<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 76</p> 77 78<H2>Revision History</H2> 79<p> 802007/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> 81</p> 82 83<hr><p>CONFIDENTIAL</p></body> 84</html>