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>NANDReadDir</title> 9</head> 10 11<body> 12 13<h1>NANDReadDir</h1> 14 15<h2>C Specification</h2> 16<dl><dd><pre><code> 17#include <revolution/nand.h> 18 19#define NAND_MAX_NAME 12 20 21s32 NANDReadDir(const char *dirName, char *nameList, u32 *num); 22</code></pre></dd></dl> 23 24<h2>Arguments</h2> 25<p> 26<TABLE border="1" > 27 <tr> 28<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><STRONG><EM><CODE>dirName</CODE></EM></STRONG></EM></STRONG></CODE></TD> 29<TD width="520">Directory name. </TD> 30 </tr> 31 <tr> 32<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><STRONG><EM><CODE>nameList</CODE></EM></STRONG></EM></STRONG></CODE></TD> 33<TD width="520">Buffer start address for storing the file and directory list that is contained in the specified directory. This buffer must be aligned on a 32-byte address boundary. If NULL is specified, the list is not stored. </TD> 34 </tr> 35 <tr> 36<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM><STRONG><EM><CODE>num</CODE></EM></STRONG></EM></STRONG></CODE></TD> 37<TD width="520">Stores the number of files and directories that are contained in the specified directory. </TD> 38 </tr> 39</TABLE> 40</p> 41 42<h2>Return Values</h2> 43<p> 44Returns one of the following codes: 45<p> 46<code>NAND_RESULT_OK<br> NAND_RESULT_ACCESS<br> NAND_RESULT_INVALID<br> NAND_RESULT_NOEXISTS<br> NAND_RESULT_UNKNOWN<br> NAND_RESULT_FATAL_ERROR<br></code> 47</p> 48</p> 49 50<H2>Description</H2> 51<p> 52Gets a list of files and directories contained in the specified directory. If the list size is unknown, retrieve the list using the following steps. 53<ol> 54<li>Call this function with the second argument set to <CODE>NULL</CODE>. The number of elements in the list is written to the location pointed to by <STRONG><EM><CODE>num</CODE></EM></STRONG>. 55<li>Allocate a memory block with the size [ (Number of Elements) x (<CODE>NAND_MAX_NAME</CODE>+1)] or larger. 56<li>Call this function again with the allocated memory start address as the second argument. 57<li>The number of elements of the list that was retrieved is stored in <STRONG><EM><CODE>num</CODE></EM></STRONG> (this value may be less than the value in the first call to this function), and the file and directory list with a null character separator is stored in the allocated memory. 58</ol> 59</p> 60 61<h2>See Also</h2> 62<p> 63<code><a href="./NANDReadDirAsync.html">NANDReadDirAsync</a></code> 64</p> 65 66 67<H2>Revision History</H2> 68<p>06/16/2006 Initial version.</p> 69 70 71</body> 72</html> 73